1. OT - for a laugh
- Posted by ChrisB (moderator) Oct 15, 2009
- 1088 views
I think I am going senile. I've spent the last 2 hours wondering why this wouldn't work (on Linux)
system("rename " & fname & " " & nfname, 0)
until I realised there is no rename, and it should be
system("mv " & fname & " " & nfname, 0)
Big groan.
Chris
2. Re: OT - for a laugh
- Posted by jimcbrown (admin) Oct 15, 2009
- 1131 views
I think I am going senile. I've spent the last 2 hours wondering why this wouldn't work (on Linux)
system("rename " & fname & " " & nfname, 0)
until I realised there is no rename, and it should be
system("mv " & fname & " " & nfname, 0)
Big groan.
Chris
You know, there is an actual rename command for Linux:
http://linux.about.com/library/cmd/blcmdl1_rename.htm
And you can download it here:
http://tips.webdesign10.com/files/rename.pl.txt
From here:
http://tips.webdesign10.com/how-to-bulk-rename-files-in-linux-in-the-terminal
3. Re: OT - for a laugh
- Posted by jeremy (admin) Oct 15, 2009
- 1082 views
I think I am going senile. I've spent the last 2 hours wondering why this wouldn't work (on Linux)
system("rename " & fname & " " & nfname, 0)
We all do it! My best one was trying to solve a report problem. Well, the particular report I was working on was just like report ABC, so we copied ABC and made a slight change, thus, duplicated a lot of code! Anyway, I was working on the wrong report (right section of code) for nearly an hour wondering why my changes were not being applied to the system.
Jeremy
4. Re: OT - for a laugh
- Posted by ghaberek (admin) Oct 15, 2009
- 1078 views
- Last edited Oct 16, 2009
Add these to your ~/.bashrc file.
alias cls='clear' alias del='rm' alias move='mv' alias ren='mv' alias rename='mv'
-Greg
5. Re: OT - for a laugh
- Posted by ChrisB (moderator) Oct 16, 2009
- 1086 views
Hi
Cheers chaps.
As Jim says there was already a rename, I was trying
rename file_old_name file_new_name
It should have been
rename file_old_name to_file_name list_of_files
Of course, nothing was coming back, so I didn't get a syntax error, and I didn't get a new name, but I did find myself hunting through my own system looking for the new files, wondering if I was accidentally root, etc etc.
As far as alias - yes I knew about that (use it for a few things), but I've never found myself so intellectually tunnel vision fixated on why rename didn't work, as to wonder why I don't just use alias for mv.
Ho hum. I've learnt (or re learnt yet again) another new (or old) thing (again)
Chris