Re: [PLUG] Removing initial characters from all file names in directory

2019-02-09 Thread Rich Shepard
On Fri, 8 Feb 2019, Russell Senior wrote: I should clarify also that ## removes the prefix. %% removes the suffix. Both are useful. Read your shell's manpage for full details. Russell, Thanks for the details. I had not before seen these used when I referenced my bash shell scripting book. Re

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Russell Senior
I should clarify also that ## removes the prefix. %% removes the suffix. Both are useful. Read your shell's manpage for full details. On Fri, Feb 8, 2019 at 1:36 PM Russell Senior wrote: > The $(FOO##BAR} syntax removes BAR from $FOO, so modify BAR to match want > you want removed. > > On Fri, F

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Rich Shepard
On Fri, 8 Feb 2019, Russell Senior wrote: The $(FOO##BAR} syntax removes BAR from $FOO, so modify BAR to match want you want removed. Russell, Figured that was the case so added an underscore to ##BAR_. Carpe weekend, Rich ___ PLUG mailing list PL

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Paul Heinlein
On Fri, 8 Feb 2019, Russell Senior wrote: for i in BMRR_* ; do echo mv $i ${i##BMRR} ; done So close! for i in BMRR_* ; do echo mv $i ${i##BMRR_} ; done -- Paul Heinlein heinl...@madboa.com 45°38' N, 122°6' W___ PLUG mailing list PLUG@pdxlinux.or

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Russell Senior
The $(FOO##BAR} syntax removes BAR from $FOO, so modify BAR to match want you want removed. On Fri, Feb 8, 2019 at 1:32 PM Rich Shepard wrote: > On Fri, 8 Feb 2019, Russell Senior wrote: > > > It won't look exactly right, fwiw. > > Russell, > > True. The initial underscore remains. Will futz unt

Re: [PLUG] Removing initial characters from all file names in directory [REALLY SOLVED]

2019-02-08 Thread Rich Shepard
On Fri, 8 Feb 2019, Russell Senior wrote: You ought to be able to figure out what's wrong and correct it. Retry until it does look right *before* you remove the "echo". Russell, For the record, the working script is: for i in BMRR_* ; do mv $i ${i##BMRR_} ; done Best regards, Rich _

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Rich Shepard
On Fri, 8 Feb 2019, Russell Senior wrote: It won't look exactly right, fwiw. Russell, True. The initial underscore remains. Will futz until it's gone. Robert's suggested use of rename worked for him, but not for me for some unknown reason. Thanks, Rich __

Re: [PLUG] Removing initial characters from all file names in directory [SOLVED]

2019-02-08 Thread Rich Shepard
On Fri, 8 Feb 2019, Robert Citek wrote: $ rename 's/^BMRR_//' BMRR_* Robert, Ah, I tried that with only * at the end, forgetting to specify the entire file pattern. Thanks very much, Rich ___ PLUG mailing list PLUG@pdxlinux.org http://lists.pdxlin

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Russell Senior
It won't look exactly right, fwiw. You ought to be able to figure out what's wrong and correct it. Retry until it does look right *before* you remove the "echo". On Fri, Feb 8, 2019 at 1:21 PM Russell Senior wrote: > for i in BMRR_* ; do echo mv $i ${i##BMRR} ; done > > if that looks right, then

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Russell Senior
for i in BMRR_* ; do echo mv $i ${i##BMRR} ; done if that looks right, then remove the "echo" and re-run. On Fri, Feb 8, 2019 at 1:07 PM Rich Shepard wrote: > I have a directory with 30 files. Each filename begins with BMRR_ and I > want > to strip that off, leaving the rest of the name unchan

Re: [PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Robert Citek
$ ls -1 BMRR_Pits.cpg BMRR_Pits.dbf BMRR_Pits.prj BMRR_Pits.shp BMRR_Pits.shx $ rename 's/^BMRR_//' BMRR_* $ ls -1 Pits.cpg Pits.dbf Pits.prj Pits.shp Pits.shx Regards, - Robert On Fri, Feb 8, 2019 at 1:05 PM Rich Shepard wrote: > I have a directory with 30 files. Each filename begins with BM

[PLUG] Removing initial characters from all file names in directory

2019-02-08 Thread Rich Shepard
I have a directory with 30 files. Each filename begins with BMRR_ and I want to strip that off, leaving the rest of the name unchanged. There are 5 different extensions on the files. I've used rename to change file extensions but not characters at the front or middle of filenames. My web searches