Date: Wed, 8 Jan 2003 18:01:50 +0200 (EET) From: "BigBrother (BigB3)" <bigbrother@bonbon.net> To: freebsd-questions@freebsd.org Subject: Renaming files with spaces in the name to files without spaces.. Message-ID: <20030108175539.W65616@bigb3server.bbcluster.gr>
next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sorry for this OT but I am trying for some hours to achieve a massive rename of files using a simple script and I have not success yet. I want to rename files like "RESULTS OF JAN 01 2002.txt " to "RESULTS_OF_JAN_01_2002.txt" i.e. all the spaces, being substituted by '_', and the last space being completely removed [yes it has a space after the suffix] I tried to experiment with sed/awk and creating a sample sh script with for i in 'ls' .... but the i takes values of 'RESULTS' 'OF' 'JAN'. This means that it doesnt take the full filename as value, but parts of the filenames. Can u please suggest an easy way to implement the massive rename? Thank you very very much in advance!!!! - --- We are being monitored..but there is a solution... Use PGP for signing and encrypting emails!!!! Download my public key at http://www.us.pgp.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+HEtwGe/V3CxAyHoRAjmmAJ0VIpM/GjywRp6akCEuCaAP636okQCeL3g0 shL8qGgwBEIvbuSEBMHof8w= =Q8dy -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030108175539.W65616>