PDA

View Full Version : i am kinda new to program and i need help



daberkayboya
November 9th, 2006, 12:17 AM
this is what he wrote on the board for us to do in shell script:
make a script called editf
will take three parameters
*check for three parameters <-- if [- ]
*put out error if three parameters are not present
put out a usage message
=
1st parameter is string we want to replace
2nd parameter is string we want to insert in place of old string
3rd parameter is a directory if [-d__] directory exists

the script needs to go to the directory and get all file-name and use sed to change all of the files. make temporary files on /tmp using /tmp/editf.$$ and then copy temp files back over files in your directory

make a test directory outside of your script and put in 3 or 4 files for testing the files should have multiple occurrences of the string you are changing

commands with
##
##comment
##
for statement to loop through files
use sed for changing




also any good sites for programming games would be appreciated.
thx

po0f
November 9th, 2006, 03:19 AM
Advanced Bash-Scripting Guide (http://tldp.org/LDP/abs/html/).

Sed - An Introduction and Tutorial (http://www.grymoire.com/Unix/Sed.html).

Please attempt your assignment before asking for help, thank you.