diff --git a/README.md b/README.md index 4ab8425..1540559 100644 --- a/README.md +++ b/README.md @@ -617,12 +617,12 @@ sed "s/$/\t$i/" # $i is the valuable you want to add # To add the filename to every last column of the file -for i in $(ls);do sed -i "s/$/\t$i/" $i;done +for i in $(ls); do sed -i "s/$/\t$i/" $i; done ``` ##### Add extension of filename to last column ```bash -for i in T000086_1.02.n T000086_1.02.p;do sed "s/$/\t${i/*./}/" $i;done >T000086_1.02.np +for i in T000086_1.02.n T000086_1.02.p; do sed "s/$/\t${i/*./}/" $i; done >T000086_1.02.np ``` ##### Remove newline\ nextline @@ -1055,7 +1055,7 @@ if [[ $age -gt 21 ]]; then echo -e "forever 21!!" ; fi ##### For loop ```bash # Echo the file name under the current directory -for i in $(ls); do echo file $i;done +for i in $(ls); do echo file $i; done #or for i in *; do echo file $i; done @@ -1063,7 +1063,7 @@ for i in *; do echo file $i; done for dir in $(