D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] I'm back :-)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 24 June 2003 23:15, Simon Waters wrote:
> Not tested on directories, and the brave would do the eval in a "find"
> command, the clever would do it without creating a subprocess for each
> expr.

And people like me would just hold their head in their hands a cry ;-)

> Oh multiple question marks are a pain, but you can always run it more
> than once.

There shouldn't be multiple question marks in the URL.

> Comes with the usual, "you ran what!?" warranty, if it destroys your
> files, ends life as we know it on the planet etc I'll refund the
> purchase price ;-)

lol, that's all I expect from free software.  After all if I wanted a 
meaningful and financially supported commitment to software quality, I'd go 
to someone like Microsoft ;-)

> #!/bin/bash
> for AFILE in *\?*
> do
>  NEWNAME=`expr "$AFILE" : "\(.*\)?"`
>  if [ -a $NEWNAME ]
>  then
>     echo Duplicate file name $NEWNAME would be created
>  else
>      mv $AFILE $NEWNAME
>  fi
> done

Hmm, looks good, but it seems to b0rk at every single command.  It just says:

[jon@xxxxxx www.smssat.biz]$ ./vchop.sh
./vchop.sh: line 4: NEWNAME=./advancedsearch.html: No such file or directory
./vchop.sh: line 5: if: command not found
./vchop.sh: line 6: then: command not found
./vchop.sh: line 7: : command not found
./vchop.sh: line 8: else: command not found
./vchop.sh: line 9: : command not found
./vchop.sh: line 10: fi: command not found
8<---8<---8<---8<---8<---8<---8<---8<---

I'm not sure quite what I did to it!  The shebang line looks alright...  :-(

Cheers,

Jon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE++N0ieTVvFHAhe5cRAk0jAKCBnBl/vt/6dpItr1q3mfJhjm2LvwCeMLGX
7WXrxQsMDsziIGLGNqUfaKs=
=B/0M
-----END PGP SIGNATURE-----


--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly