corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
corz.org text viewer..
[currently viewing: / public/ linux/ usr/ local/ bin/ parse.sh - raw]
if [ "$1" != '' ]; then
for lines in $(cut -d
do
$2 $lines
done
else
clear
echo
echo " [01;33mparse[00m:[01;32m do something to each line of a text file..[00m"
echo
echo " [01;33musage:[00m [01;35mparse <file> <command(s)>[00m"
echo
echo " ..will run through <file> and do <command> to each line of text in the file."
echo " comments (lines beginning with \"
echo " up of multiple commands, enclose them in quotes.."
echo
echo " [01;35mparse pkglist \"slackpkg search\"[00m"
echo
echo " your results come back on standard output, do what you like with that.."
echo
echo " [01;35mparse pkglist \"slackpkg search\" >> output.log[00m"
echo
echo " here's something you can try at home, check on your LAN.."
echo
echo " [01;35mparse /etc/hosts \"ping -c 1\" >> lan-ping.log[00m"
echo
exit 0
fi