[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: check, that a script is in a folder



On Wed, Jan 05, 2011 at 02:27:39AM -0800, S Mathias wrote:
> $ echo ${PWD##*/}
> somefolder
> $ if "${PWD##*/}" -eq "asdf" > /dev/null; then echo "this is the asdf folder"; else exit 1; fi

if [ "${PWD##*/}" == "asdf" ]; then echo "this is the asdf folder"; else exit 1; fi


Why not simple use:

if [ -e $SCRIPT ]; then
  echo "File exists";
else
  echo "File does not exist";
fi



Regards,
Didar


Reply to: