Computing.Net > Forums > Unix > Shell script HTML move

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell script HTML move

Reply to Message Icon

Name: oxi2k
Date: December 17, 2002 at 20:56:57 Pacific
OS: Unix any
CPU/Ram: any
Comment:

Have a nice script to write, but need some help.
Write a script that will transfer all html from a specified or current by default dir to public_html. And move all pictures *.gif and .jpg files to public_html/pics dir. So htmlmv executed in you dir, then it should move all *.htm or .html files to ~username/public_htm dir and ~username/public_htm/pics dir. And one more thing if htmlmv executed with an option [-d] dirname move all files to ~user/dirname.
Thanx in advance,
David



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: December 18, 2002 at 06:32:14 Pacific
Reply:

#!/bin/sh
cd ~
if [ ! -d ~/public_html ] ; then
mkdir ~/public_html
fi
mv ~/*.html ~/public_html/
mv ~/*.gif ~/public_html/pics/
mv ~/*.jpg ~/public_html/pics/


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell script HTML move

Shell Script help - move records www.computing.net/answers/unix/shell-script-help-move-records/7061.html

backup a file with SHELL SCRIPT www.computing.net/answers/unix/backup-a-file-with-shell-script/4522.html

shell script help www.computing.net/answers/unix/shell-script-help/6490.html