1. OT - for a laugh

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

new topic     » topic index » view message » categorize

2. Re: OT - for a laugh

ChrisB said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: OT - for a laugh

ChrisB said...

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: OT - for a laugh

Add these to your ~/.bashrc file.

alias cls='clear' 
alias del='rm' 
alias move='mv' 
alias ren='mv' 
alias rename='mv' 


-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: OT - for a laugh

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu