So What I understand you need to run script around lot of servers parallel. Copy the scrip to all servers and put in cron etc .... if you feel the script changes all the time then use
1. scp to copy script to all servers .
2. set at job or cron using ssh once scp is done.
About the script which you asked ... looks like it is trying to get rid of .txt extensions from all file in $dir directory ...
Quote:
Originally Posted by
fofatoti
for i in "$dir"/*.txt
do
echo ${i%%} | sed 's#^.*/##' | sed 's/\.//' | sed 's/txt//' | cat >> $dir/Network_Elements.out
done
filename=$dir/Network_Elements.out
Here is a easy way you can replicate ...
1. go to test server/tmp/where you cannot harm server
[very imp]
2. copy the lines in a file
3. make it executable
4. make/copy some .txt files from production server
Now you can see what happns
You should learn some bash scripting and sed . what I can see in script is script is basically checking some file and batch_rlogin might be script/alias which external to this script.
Contact me if you need more help