NOTE
While the # and % identifiers may not seem obvious, they have a convenient mnemonic. The # key ... ash shell has many features that are sufficiently obscure you almost never see them used. One of the p... for i in *.txt; do cp $i ${i%.txt}.bak; done
... obviously this is more typing. If you tried to creat... d ]; do d=${p%%:*}; p=${p#*:}; echo $d; done
... obviously you can replace the echo $d part of this c