[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] how to bulk rename files
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] how to bulk rename files |
Date: |
Thu, 12 Apr 2012 08:19:41 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Thu, Apr 12, 2012 at 11:05:41AM +0800, Clark Wang wrote:
> On Thu, Apr 12, 2012 at 04:54, DJ Mills <address@hidden> wrote:
> > This is a TERRIBLE idea, as attempting to word-split a command
> > substitution will fail horribly on any filenames with spaces (which is
> > very common in Windows), and will attempt pathname expansion on the
> > output. A simple glob should be used, or -exec if find is used.
>
> A glob expansion may cause the command line to be too long since the OP has
> 2.5 million files?
A glob expansion being passed as an argument list to a command will
fail, yes. But a glob expansion being used internally as the list
in a bash "for" command will be OK.
for f in *; do
mv -- "$f" "$f.txt"
done
- [Help-bash] how to bulk rename files, lxnf98mm, 2012/04/11
- Re: [Help-bash] how to bulk rename files, DJ Mills, 2012/04/11
- Re: [Help-bash] how to bulk rename files, Clark Wang, 2012/04/12
- Re: [Help-bash] how to bulk rename files,
Greg Wooledge <=
- Re: [Help-bash] how to bulk rename files, Stephane Chazelas, 2012/04/12
- Re: [Help-bash] how to bulk rename files, Greg Wooledge, 2012/04/12
- Re: [Help-bash] how to bulk rename files, lxnf98mm, 2012/04/12
- Re: [Help-bash] how to bulk rename files, Chet Ramey, 2012/04/12
Re: [Help-bash] how to bulk rename files, DJ Mills, 2012/04/11
Re: [Help-bash] how to bulk rename files, Steven W. Orr, 2012/04/12
Re: [Help-bash] how to bulk rename files, Conrad J. Sabatier, 2012/04/22