I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called "ANES.sh" (script1)
3)this loop countinues until all entries in text file are processed
4) give exit to loop
5) then executes another script (script2) with -r -y option
Also I want to capture error messages and create log file for this script.
-------------------------------------------------
MY CODE:
#! /bin/sh
GDCMD=path to script1
RAFOL=path to script2
TEXTFILE=path to text file
while read line
do
$GDCMD
done <textfile.txt
$RAFOL -r -y 2009
-------------------------------------------------------
I know that I have not put any loop here to execute script1 for each entries of text file. Also i have not out any exit coomand & not captured any log files.Kindly help.
system() call inside awk will not print anything on the screen I guess! But your script should get executed. You can redirect the output to some log and check.