All pastes #24695 Raw Edit

Stuff

public text v1 · immutable
#24695 ·published 2005-10-05 19:52 UTC
rendered paste body
#!/bin/bash
file=$1
if $file=0
   then
     echo "Usage'
fi
if [ -e $file ]
  then
    echo "Executing script on file."
  else
    echo "File not found."
    exit
fi
if [ -x $file ]
  then
    echo "File can be run."
  else
    echo "File cannot be run, adding execute permission."
    chmod +x $file
    exitstatus=$?
      if [ $exitstatus -eq 0 ]
         then
           echo $1 "Sucessfully added execute permission."
         else
           echo "Did not sucessfully add execute permission."
      fi

fi

echo "--End of Program--"
exit