François Cerbelle <[EMAIL PROTECTED]>:
> Bob McGowan a écrit :
> >
> > Why do this with a `ls` when a simple * will work?
> > for a in *; do ...
>
> Hum... Because ! ;-)
>
> In fact, first, I used to do this, because I seldomly use all files in a
> single directory, but often a pattern in a
Le Ven 21 novembre 2008 02:10, Ding Honghui a écrit :.jpg
> [EMAIL PROTECTED]:~/test/jpg$ ls | awk -F_ '{print $2}'
> 3563
> 3616
> 3620
IMHO, awk is quite oversized just to cut fields... It is typically a cut
job : "cut -d_ -f2" ;-)
Fanfan
--
http://www.cerbelle.net - http://www.afdm-idf.org
On Fri, 21 Nov 2008 09:10:08 +0800
Ding Honghui <[EMAIL PROTECTED]> wrote:
> tôba wrote:
> > Hello,
> >
> > Can you help me with a bash command?
> > I a directory, I want to extract with a command line for jpg name
> > files. I have a lot of:
> >
> > icon_3620_0_1.jpg
> > icon_3616_0_1.jpg
> > i
tôba wrote:
> Hello,
>
> Can you help me with a bash command?
> I a directory, I want to extract with a command line for jpg name files.
> I have a lot of:
>
> icon_3620_0_1.jpg
> icon_3616_0_1.jpg
> icon_3563_0_1.jpg
>
> I want to extract the number betwen icon_*_0_1.jpg AND I want to use
> the
Bob McGowan a écrit :
for a in `ls`; do DIR=`echo $a | cut -d_ -f2`; echo mkdir -p $DIR
/$a; echo rmdir $DIR/$a; echo mv $a $DIR/$a; done
...
Why do this with a `ls` when a simple * will work?
for a in *; do ...
Hum... Because ! ;-)
In fact, first, I used to do this, because I seldomly use
tôba wrote:
> Hello,
>
> Can you help me with a bash command?
> I a directory, I want to extract with a command line for jpg name files.
> I have a lot of:
>
> icon_3620_0_1.jpg
> icon_3616_0_1.jpg
> icon_3563_0_1.jpg
>
> I want to extract the number betwen icon_*_0_1.jpg AND I want to use
> the
On Thu, 2008-11-20 at 17:27 +0100, François Cerbelle wrote:
> Le Jeu 20 novembre 2008 16:18, tôba a écrit :
> > icon_3620_0_1.jpg
> > icon_3616_0_1.jpg
> > icon_3563_0_1.jpg
> >
> > The goal is to create a directory called 3620 and move the
> > icon_3620_0_1.jpg file into this directory.
> >
> > S
Le Jeu 20 novembre 2008 16:18, tôba a écrit :
> icon_3620_0_1.jpg
> icon_3616_0_1.jpg
> icon_3563_0_1.jpg
>
> The goal is to create a directory called 3620 and move the
> icon_3620_0_1.jpg file into this directory.
>
> So, I did like this for test:
> # for a in `ls | sed -e s'/_/ /g' | awk '{prin
On Thu, 20 Nov 2008 13:28:17 -0200
Eduardo M KALINOWSKI <[EMAIL PROTECTED]> wrote:
> tôba escreveu:
> > Hello,
> >
> > Can you help me with a bash command?
> > I a directory, I want to extract with a command line for jpg name
> > files. I have a lot of:
> >
> > icon_3620_0_1.jpg
> > icon_3616_0_1.
tôba escreveu:
> Hello,
>
> Can you help me with a bash command?
> I a directory, I want to extract with a command line for jpg name files.
> I have a lot of:
>
> icon_3620_0_1.jpg
> icon_3616_0_1.jpg
> icon_3563_0_1.jpg
>
> I want to extract the number betwen icon_*_0_1.jpg AND I want to use
> the
Hello,
Can you help me with a bash command?
I a directory, I want to extract with a command line for jpg name files.
I have a lot of:
icon_3620_0_1.jpg
icon_3616_0_1.jpg
icon_3563_0_1.jpg
I want to extract the number betwen icon_*_0_1.jpg AND I want to use
the entire filename too in the same com
11 matches
Mail list logo