Shell Script writing (URGENT)
Posted 04-14-2010 at 02:04 PM by path_finder
Write a shell script that swaps the contents of two files. The shell script should be called swap.sh.
The swap.sh script should take two arguments as input. They indicate the two files to be swapped. You should check that the proper number of arguments have been passed and that the filenames passed on the command line have the proper permissions set. You should also check that any temporary files used during the execution of the script do not exist. If any of these checks fail, then print an appropriate error message and exit the script with a status of one. If all of the checks pass, then swap the two specified files and print a message indicating that the two files have been swapped.
Thanks in Advance
The swap.sh script should take two arguments as input. They indicate the two files to be swapped. You should check that the proper number of arguments have been passed and that the filenames passed on the command line have the proper permissions set. You should also check that any temporary files used during the execution of the script do not exist. If any of these checks fail, then print an appropriate error message and exit the script with a status of one. If all of the checks pass, then swap the two specified files and print a message indicating that the two files have been swapped.
Thanks in Advance
Total Comments 0