Re: Scripting
- From: Hadron <hadronquark@xxxxxxxxxxxxxx>
- Date: Mon, 31 Dec 2007 12:29:50 +0100
Chris Elvidge <chris.elvidge@xxxxxxxxxxxxxxxx> writes:
Calab wrote:
"Chris Elvidge" <chris.elvidge@xxxxxxxxxxxxxxxx> wrote in messageDid you try quotes round $i too?
news:c3om45-1e1.ln1@xxxxxxxxxxxxxxxxxxx
Calab wrote:
try for i in "$(ls -l)"#!/bin/bashFor some reason, $i does not contain the complete line. It only
for i in $(command)
do
j=$(echo "$i" | cut -f4)
k=$(echo "$i" | cut -f3)
[ "$j" = "busy" ] && syscheck "$k"
done
#
where "command" gives your table, "cut" assumes tabs are the
column delimiters. - man cut
contains one column...
Tried a very simple run and you can see that each line output by
the ls -l command is split up.
bash-2.05$ for i in $(ls -l) ; do(echo $i ) ; done
Nope... that returns ALL of the ls output as a single line, instead
of an instance of $i for each line.
Watching this unfold, I have one question : did this solution you gave
work for you?
.
- References:
- Scripting
- From: Calab
- Re: Scripting
- From: Chris Elvidge
- Re: Scripting
- From: Calab
- Re: Scripting
- From: Chris Elvidge
- Re: Scripting
- From: Calab
- Re: Scripting
- From: Chris Elvidge
- Scripting
- Prev by Date: Re: looking for that elusive distro
- Next by Date: Re: looking for that elusive distro
- Previous by thread: Re: Scripting
- Next by thread: looking for that elusive distro
- Index(es):