Google Search

Thursday, October 6, 2011

Write an interactive file handling shell program. Let it offer the user the choice of copying ,removing ,renaming or linking files. Once the use has made a choice, have the program ask the user for necessary information, such as the file name ,new name and so on.



(a) Write an interactive file handling shell program. Let it offer the user the choice of copying ,removing ,renaming or linking files. Once the use has made a choice, have the program ask the user for necessary information, such as the file name ,new name and so on.
(b) Write a shell script that takes a login name as command –line argument and reports when that person logs in
(c) Write a shell script which receives two files names as arguments. It should check whether the two file contents are same or not. If they are same then second file should be deleted.


PROGRAM

echo "Enter I File Name:"
read f1
echo "Enter II File Name:"
read f2
d=`cmp $f1 $f2`
d1=""
if [ $d -eq $d2 ]
then
            echo "Two Files are similar and $f2 is deleted"
            rm $f2        
else
            echo "Two Files differ each other"
fi



0 comments:

Post a Comment