[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SLUG] recursive %20 to " "
Hello,
> i set up a ftp server and wget (got??) all the files not a prob but it seems to
Might have been better to use something like samba?
smb: \> recurse
smb: \> prompt
smb: \> mget *
> have changed all my spaces to %20 and all @nospam. to %40 or whatever.
> I am storing all the data on a fat32 partition i had lying around and i was
> wondering if there is an easy way /script to make all the names back to normal.
> ie
> my folder
> instead of
> my%20folder
Maybe try something like:
#! /bin/sh
for file in `find *`; do
newname=`echo $file | sed s/'%20'/' '/g | sed s/'%40'/'@nospam.'/g`;
if [ "$file" != "$newname" ] ; then
mv "$file" "$newname";
fi;
done
as a "neat" script, or
for file in `find *`; do newname=`echo $file | sed s/'%20'/' '/g | sed
s/'%40'/'@nospam.'/g`; if [ "$file" != "$newname" ] ; then mv "$file" "$newname";
echo $newname; fi ; done
for a one line shell command (Hi Gus).
You could add more sed stuff there too.
I am also quite sure that there would be a neater way to do this, as I am
not overly experienced :-) Just a quick hack.
Good Luck,
- Simon
--
And the Lord said: "Let there be Windows(tm)!"
And the sky went blue...
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text