I have some script name along with their path stored in a text file. The text files contains paths like
/myhome/new1/myfiles/test2.sh /myhome/new3/myfiles/test1.sh /myhome/new2/myfiles/test4.sh /myhome/new/myfiles/test5.sh
these shell files are being called by some main scripts
I want to go the path, the main path are present in the path(i dont know how to get the path, couldn't sed last delimiter)
I want to grep the filename(to get the file name use
sed 's/.*\///' new.txt) and store the filename that is of type shell script into a text file.
The output in the text file should be something like path along with scriptname along with main script name
/myhome/new1/myfiles/test2.sh test2 test2main.sh /myhome/new3/myfiles/test1.sh test1 test1foo.sh /myhome/new2/myfiles/test4.sh test4 test4bar.sh /myhome/new/myfiles/test5.sh test5 baz5main.sh
testo4bar.sh ... are main scripts that call these files.