check, that a script is in a folder

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

 



$ 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?

I just want to check, that a script is in a folder, and if it isn't, then it exits


      
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux