Advertisement
diyfuturism

up.sh

Dec 2nd, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. # https://stackoverflow.com/questions/188162/what-is-the-most-useful-script-youve-written-for-everyday-life
  2. # /a/very/deeply/nested/path/somewhere> up 4
  3. # /a/very>
  4.  
  5. #!/bin/bash
  6. LIMIT=$1
  7. P=$PWD
  8. for ((i=1; i <= LIMIT; i++))
  9. do
  10.     P=$P/..
  11. done
  12. cd $P
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement