Skip navigation.

My pasteblog

This is not my Zettelkasten but a durable .bash_history

More bash var chopping

,

http://my.opera.com/cpr/blog/show.dml/206175

Leaving basename() behind by chopping from the end of the variable-string:

$ for f in `ls *gif`;do echo $f; convert.exe $f ${f%.gif}.png;done
first_basic_admin.gif
first_comments_under_post.gif
first_congrats.gif
first_crud.gif
first_crud_layout.gif
first_custom_admin.gif
first_form_validation.gif
first_login.gif
first_routing.gif
first_welcome.gif
bash-3.00$ ls
first_basic_admin.gif          first_crud.png             first_login.gif
first_basic_admin.png          first_crud_layout.gif      first_login.png
first_comments_under_post.gif  first_crud_layout.png      first_routing.gif
first_comments_under_post.png  first_custom_admin.gif     first_routing.png
first_congrats.gif             first_custom_admin.png     first_welcome.gif
first_congrats.png             first_form_validation.gif  first_welcome.png
first_crud.gif                 first_form_validation.png  symfony_favicon.png
$ for p in `ls *png`; do echo \\pgfdeclareimage\{${p%.png}\}{pictures/${p%.png}};done

Caveat: Sanitize underscore in pgfimage handle

IMG_0020.JPG 020.JPG IMG_x020.JPG
IMG_0021.JPG 021.JPG IMG_x021.JPG
IMG_0022.JPG 022.JPG IMG_x022.JPG
IMG_0023.JPG 023.JPG IMG_x023.JPG
bash-3.1$ for f in `ls *JPG`; do mv $f IMG_x${f#IMG_0};  done

Frameworks und VertrauenTroll TROLLING PUBLIC LICENSE

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31