[CentOS] check, that a script is in a folder

Wed Jan 5 10:42:03 UTC 2011
John R. Dennison <jrd at gerdesas.com>

On Wed, Jan 05, 2011 at 02:26:12AM -0800, S Mathias wrote:
> $ echo ${PWD##*/}
> somefolder
> $ if "${PWD##*/}" -eq "asdf" > /dev/null; then echo "this is the asdf folder"; else exit 1; fi
> bash: notthatfolder: command not found...
> this is the asdf folder
> $ 
> 
> 
> So i just want to check that i'm in an exact folder. e.g.: "asdf"
> 
> What's wrong with my one-liner?

	What's wrong is you can't read man pages or research on your
	own.  "man bash"; your problem is covered there.




								John

-- 
Much of what looks like rudeness in hacker circles is not intended to give
offense. Rather, it's the product of the direct, cut-through-the-bullshit
communications style that is natural to people who are more concerned about
solving problems than making others feel warm and fuzzy.

http://www.tuxedo.org/~esr/faqs/smart-questions.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20110105/99f187cd/attachment-0005.sig>