seanesean
06-09-2002, 03:41 PM
I am trying to learn some simple scripts and have a simple question. I can't figure out how to use variable filenames in place of the ones I have below. Would some1 be so kind as to show me how the below example could be turned into a script utilizing variables in place of filenames???
#!/bin/sh
cp /varlog/rpmpkgs /public_html/scripting.txt
#copy rpmpkgs file to a new file in public_html called scripting.txt
cat /tmp/break >> /public_html/scripting.txt
#append scripting.txt file with contents of /tmp/break
cat script.sh >> /public_html/scripting.txt
#append scripting.txt with contents of this #file
chmod 755 /public_html/scripting.txt
#change file permissions of scripting.txt to #rwxr-xr-x
#!/bin/sh
cp /varlog/rpmpkgs /public_html/scripting.txt
#copy rpmpkgs file to a new file in public_html called scripting.txt
cat /tmp/break >> /public_html/scripting.txt
#append scripting.txt file with contents of /tmp/break
cat script.sh >> /public_html/scripting.txt
#append scripting.txt with contents of this #file
chmod 755 /public_html/scripting.txt
#change file permissions of scripting.txt to #rwxr-xr-x