diff options
| author | Tslil Clingman <hiato1@gmail.com> | 2013-08-09 14:03:45 +0200 |
|---|---|---|
| committer | Tslil Clingman <hiato1@gmail.com> | 2013-08-09 14:03:45 +0200 |
| commit | f2b32d25177be465c7209072eb93ae14fc16dfa3 (patch) | |
| tree | 52e8d412518d5b3d4c70c068b7ef11dde6cac03d /ranpas | |
| parent | 3bd9f307d5cd0128ea4fa37aaecaadac5629521c (diff) | |
The vcs script I use for my PS1 and some minor changes
Diffstat (limited to 'ranpas')
| -rwxr-xr-x | ranpas | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2,9 +2,10 @@ #!/bin/bash echo Fetching paste list ... -lst="$(wget pastie.org/pastes -q -O - | sed -n "0,/[\ \t]*e=\$('paste_/s///p" | tr -d "');")" +lst=`wget pastie.org/pastes -q -O - | grep "id='paste" | head -n 1 | sed "s/.*id='paste_\([0-9]*\)'.*/\1/"` echo Newest paste is $lst. +r="" while :; do rnd="$(ruby -e "$><<1+rand($lst)")" echo -e "\n"Looking up paste $rnd ... @@ -16,12 +17,14 @@ while :; do else less /tmp/paste-$rnd echo -n Save?\ - [ "$(line)" = "y" ] && echo Saving as paste $rnd in $HOME && cp /tmp/paste-$rnd $HOME + read r + [ "$r" = "y" ] && echo Saving as paste $rnd in $HOME && cp /tmp/paste-$rnd $HOME fi; else echo Empty paste. fi; rm /tmp/paste-$rnd echo -n Quit?\ - [ "$(line)" = "y" ] && exit + read r + [ "$r" = "y" ] && exit done; |
