Advertisement
s243a

append_prefixes

Jan 16th, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. # http://www.pearltrees.com/s243a/append-prefixes-strip-from/id15335224
  2. # http://murga-linux.com/puppy/viewtopic.php?t=101911
  3.  
  4. #!/bin/bash
  5. if [[ ${#2} -gt 0 ]]; then
  6.   for aPath in $2; do
  7.     echo "aPath=$aPath"  > "`tty`" # Print to terminal
  8.     new="$1$aPath"
  9.     echo "new=$new"  > "`tty`"   # Print to terminal (This doesn't seem to work)
  10.     echo "$new" # Write to pipe
  11.   done
  12. else
  13.   while read aPath; do
  14.     #echo "aPath=$aPath"  > "`tty`" # Print to terminal
  15.     new="$1$aPath"
  16.     #echo "new=$new"  > "`tty`"   # Print to terminal
  17.     echo "$new" # Write to pipe
  18.   done
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement