Hi,
I have a list file which has script names in them. Some scripts take lists as parameters which inturn have script names. This is basically for sequencing the job run.
I am trying to grep every line in List1, if it contains .lst get the list file name and echo the contents to create the master list.
It gives me an error as the line contains a script name and the script is not in the directory.
Is there a wat I can grep a line in a file which contains a script name?
#!/bin/ksh
while read line
do
echo $line
sublst_name1=`echo $line | cut -d " " -f2`
echo $sublst_name1
lst_cnt=$(grep -i .lst $sublst_name1 | wc -l)
echo $lst_cnt
done <"$lst_file"
Thanks Aia. egrep is giving me the lines in the List1 which have .lst
I need to get the specific .lst names and read its contents to the output file as well.
Which is why I am looping through the lines and grep in every line separately.
test2.ksh and test3.ksh read the .lst file and execute the scripts in the list. They are just like wrappers. The result list here needs to be just the actual scripts that execute.
The List1 is the main script which executes all scripts under it. When the execution comes to the line test3.ksh test3.lst, it call test3.ksh with test3.lst as the parameter. All that the script does is it executes the list of scripts under the test3.lst.
So when I create the master list I dont need the entry test3.ksh test3.lst and instead I need the scripts list inside the test3.lst.
For this I am looping through the List1, when the script finds a line with .lst, it replaces that line with the contents (script list) of the .lst file. Does this make sense?