Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # http://www.pearltrees.com/s243a/strip-prefixes-from-ruby-load/id15335221
- # http://murga-linux.com/puppy/viewtopic.php?t=101911
- #!/bin/bash
- echo "stripping prefixes" > "`tty`"
- echo '$1='"$1" > "`tty`" # Print to terminal
- #for aPath in `read`; do
- if [[ ${#2} -gt 0 ]]; then
- for aPath in $2; do
- echo "aPath=$aPath" > "`tty`" # Print to terminal
- new="${aPath#$1}"
- echo "new=$new" > "`tty`" # Print to terminal
- echo "$new" # Write to pipe
- done
- else
- while read aPath; do
- #echo "aPath=$aPath" > "`tty`" # Print to terminal (This doesn't seem to work)
- new="${aPath#$1}"
- #echo "new=$new" > "`tty`" # Print to terminal (This doesn't seem to work)
- echo "$new" # Write to pipe
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement