savetheWorld 1185920494 learn while read line ; do echo ${line%.}; done < myfile savetheWorld 1185992607 forget savetheWorld 1185992611 learn while read line; do my-command "$line"; done < inputfile \amethyst 1195440457 forget \amethyst 1195440458 learn as while read -r; do my-command "$REPLY"; done < inputfile \amethyst 1195440495 forget \amethyst 1195440504 learn as while read -r; do my-command "$REPLY"; done < inputfile; or, portably: while IFS='' read -r line; do my-command "$line"; done < inputfile kojiro 1195440568 forget kojiro 1195440587 learn while read -r; do my-command "$REPLY"; done < inputfile; or, portably: while IFS='' read -r line; do my-command "$line"; done < inputfile savetheWorld 1195445078 forget savetheWorld 1195445130 learn while read line; do my-command "$line"; done < inputfile fancier - get the command from the commandline and then do it : while read -r; do my-command "$REPLY"; done < inputfile; or, portably: while IFS='' read -r line; do my-command "$line"; done < inputfile ferret 1208525686 forget ferret 1208525743 learn for BASH: while read -r; do my-command "$REPLY"; done < inputfile # or, for BASH or posix sh: while IFS='' read -r line; do my-command "$line"; done < inputfile savetheWorld 1209314584 forget savetheWorld 1209314595 learn while read line; do my-command "$line"; done < inputfile savetheWorld 1209315681 forget savetheWorld 1209315702 learn while read line; do my-command "$line"; done < inputfile See !2 for more sophisticated examples :-) ferret 1223342833 forget ferret 1223342857 learn while read line; do my-command "$line"; done < inputfile See !1.1 for more sophisticated examples :-) ferret 1244817375 forget ferret 1244817395 learn while read -r; do my-command "$REPLY"; done