"Bash"의 두 판 사이의 차이
ph
44번째 줄: | 44번째 줄: | ||
> fi</pre> | > fi</pre> | ||
ref. [http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html expressions used with if] | ref. [http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html expressions used with if] | ||
+ | |||
+ | |||
+ | |||
+ | ==extract tar archive from stdin== | ||
+ | use <code>-</code> as the input file | ||
+ | <pre>cat largefile.tgz.aa largefile.tgz.ab | tar zxf -</pre> | ||
+ | [http://stackoverflow.com/a/11526570/766330] |
2017년 4월 4일 (화) 03:34 판
목차
manual, refs
- Mendel Cooper - Advanced Bash-Scripting Guide (aka. ABS) (한글판)
- Bash Reference Manual
- bash features
- BASH Programming - Introduction HOW-TO ★
- Bash Guide for Beginners
- Bash scripting Tutorial
bash expansion : ranges
$ echo {d..h} d e f g h $ echo {d..Z} d c b a _ ^ ] [ Z
For more information, refer wiki.bash-hackers.org.
redirection
### cp file1 file2와 같다 $ cat < file1 > file2
string : $''
$ # Single quotation in single qoute $ # http://stackoverflow.com/a/16605140/766330 $ echo \'sdlfkjsldf\' | sed $'s/\'//' sdlfkjsldf' $ # $'string' : this is special. $ # below line won't work. $ # echo \'sdlfkjsldf\' | sed 's/\'//‘
or
$ # 'or' $ if [ -z "$1" ] || [ -z "$2" ]; then > echo "Usage: `basename $0` rslt_file target_folder" > fi
extract tar archive from stdin
use -
as the input file
cat largefile.tgz.aa largefile.tgz.ab | tar zxf -