Skip to content

Instantly share code, notes, and snippets.

@hal0thane
Created July 27, 2009 06:12
Show Gist options
  • Save hal0thane/156063 to your computer and use it in GitHub Desktop.
Save hal0thane/156063 to your computer and use it in GitHub Desktop.
finding path name parts
<|tatermuffin|.../@-devtools/@-gnu|>
(ttys001|4679)
:> for (( i = 31 ; i > 0 ; i-- )); do
%- if [[ "/" = "/" ]]; then
%- slash=0
%- echo "Final slash at 4: /src"
%- fi
%- done
Final slash at 21: /src/@-devtools/@-gnu
Final slash at 15: /src/@-devtools
Final slash at 4: /src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment