![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,297
|
anyone wanna lend a hand with this shell script?
basically what it does is takes a directoryof images
kajskj.JPG evilbunny.gif anothername.png funnypic.jpeg and renames them to 1.JPG, 2.gif 3.png 4.jpeg what i want to do is make the 1.JPG to 1.jpg and 4.jpeg to 4.jpg this is what i have so far, it does what i want except for the .JPG and .jpeg part. Code:
i=1; shopt -s nullglob; for f in *.jpg *.gif *.png *.jpeg *.JPG *.JPEG *.GIF; do mv -- "$f" "$i.${f##*.}"; ((i++)); done
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,297
|
nm figured it out
Code:
i=1; shopt -s nullglob; for f in *.jpg *.gif *.png *.jpeg *.JPG *.JPEG *.GIF; do EXT="${f##*.}" EXT=${EXT,,} EXT=${EXT/jpeg/jpg} mv -- "$f" "$i.${EXT}"; ((i++)); done
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
Pussy lips i did it loloolololl
Code:
i=1; shopt -s nullglob; for f in *.jpg *.gif *.png *.jpeg *.JPG *.JPEG *.GIF; do EXT="${f##*.}" EXT=${EXT,,} EXT=${EXT/jpeg/jpg} mv -- "$f" "$i.${EXT}"; ((i++)); done |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,397
|
Juicy for pres!
|
![]() |
![]() ![]() ![]() ![]() ![]() |