Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #188980

Re: Editing Problem with bash script and sed

From Roberto C. Sánchez <roberto@debian.org>
Newsgroups linux.debian.user
Subject Re: Editing Problem with bash script and sed
Date 2017-11-14 17:30 +0100
Message-ID <uLMg1-616-3@gated-at.bofh.it> (permalink)
References <uLM6l-5Xj-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 14, 2017 at 11:07:47AM -0500, Thomas George wrote:
> 
> After experimenting with regular expressions with sed I found ls | sed -e
> s/S.*-// reduced the file names in File.txt to just the names of the Carols
> as shown in sed.txt. Used like this sed leaves the original file unchanged.
> 
You probably want the file-rename command from the rename package.  It
is a handy wrapper around the Perl File::Rename module.  It accepts Perl
RE, which is very similar to what you would use with sed.  In fact, that
particular RE that you are using should just work unmodified with
file-rename.

Regards,

-Roberto

-- 
Roberto C. Sánchez

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Editing Problem with bash script and sed Thomas George <lists@tomgeorge.info> - 2017-11-14 17:20 +0100
  Re: Editing Problem with bash script and sed Roberto C. Sánchez <roberto@debian.org> - 2017-11-14 17:30 +0100
  Re: Editing Problem with bash script and sed "Thomas Schmitt" <scdbackup@gmx.net> - 2017-11-14 19:30 +0100
    Re: Editing Problem with bash script and sed "Thomas Schmitt" <scdbackup@gmx.net> - 2017-11-14 19:40 +0100
      Re: Editing Problem with bash script and sed Greg Wooledge <wooledg@eeg.ccf.org> - 2017-11-14 19:50 +0100
    Re: Editing Problem with bash script and sed Greg Wooledge <wooledg@eeg.ccf.org> - 2017-11-14 19:50 +0100
  Re: Editing Problem with bash script and sed David Wright <deblis@lionunicorn.co.uk> - 2017-11-14 20:50 +0100
  Re: Editing Problem with bash script and sed RESOLVED Thomas George <lists@tomgeorge.info> - 2017-11-14 21:20 +0100
  Re: Editing Problem with bash script and sed Rusi Mody <rustompmody@gmail.com> - 2017-11-19 06:10 +0100

csiph-web