"Bash"의 두 판 사이의 차이

ph
이동: 둘러보기, 검색
잔글
23번째 줄: 23번째 줄:
 
<pre>### cp file1 file2와 같다
 
<pre>### cp file1 file2와 같다
 
$ cat < file1 > file2</pre>
 
$ cat < file1 > file2</pre>
 
 
 
==<code>nice</code>==
 
<pre>Usage: nice [OPTION] [COMMAND [ARG]...]
 
Run COMMAND with an adjusted niceness, which affects process scheduling.
 
With no COMMAND, print the current niceness.  Niceness values range from
 
-20 (most favorable to the process) to 19 (least favorable to the process).</pre>
 
  
  

2017년 4월 4일 (화) 03:32 판

manual, refs


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/\'//‘

[1]


or

$ # 'or' 
$ if [ -z "$1" ] || [ -z "$2" ]; then
>    echo "Usage: `basename $0` rslt_file target_folder"
> fi

ref. expressions used with if