I\'m writing a script in UNIX where I have to check whether the first character in a string is \"/\" and if it is, branch.
For example I have a string:
/
$ foo="/some/directory/file" $ [ ${foo:0:1} == "/" ] && echo 1 || echo 0 1 $ foo="server@10.200.200.20:/some/directory/file" $ [ ${foo:0:1} == "/" ] && echo 1 || echo 0 0