Business Intelligence and Analytics
Scan a file in a shell script
-- loop and scan a file : reads 1 token at a time.
for fname in `cat test1.dat` ; do
echo "Read line: " $fname
-- Read a file in Bash, 1 line at a time.
cat $logfile | egrep '[A-Z]|[a-z]|[0-9]' | while read line
/usr/local/bin/logger.sh message $logfile
-- Sample code, asks user for input within the loop!
for last_name in `cat $list1` ; do
echo "Create report card (y/n):" $last_name
if test $sel1 = "y"; then
echo "Report Card Header" > $rpt
Get the latest Rocket99 news and tech tips via