Featured Post

Thursday, March 24, 2016

shell program to check whether the given file have read write and execute permissions

/* rwxcheck.sh*/
/* hello.txt is a file in my system which have read and write permssion */
/* use ls -l to see the permissions of the file*/



echo "enter the file name "
read fname
if [ -f $fname ]
    then
      if [ -r $fname ]
      then
         echo "given file have read permission"
       elif [ -w $fname ]
      then
           echo "given file have write permission"
       elif [ -x $fname ]
      then
          echo "given file have execute permission"
       fi
 fi



/home/anil/~$  sh rwxcheck.sh
enter  the file name
 hello.txt
given file have read permission
given file have write permission

/home/anil/~$



Unix operating system Linux operating system shell programming bourn shell kourne shell c shell difference between unix and linux operating system , history of UNIX, red hat operating system. UNIX OS architecture , kernel utility programs , file handling process handling inter process communication pipes shared memory message queues socket programming TCP/IP , UDP programming , One to One chat Application , Basic shell program to add two numbers , echo function , while loops clear gt lt le ge ne eq if fi while do done case array in unix strings , cut copy paste cat dir pwd getcwd chdir command read write stat lseek fstat flock mechanism.even or add program vi editor command ni vi editor command mode esc mode insert mode aa dd x :q :wq :w

 :wq :w

No comments:

Post a Comment