for Fedora users"
> Sent: Monday, January 16, 2012 3:34:37 PM
>
> Subject: Re: OT: bash script - unexpected exit
>
> On Mon, Jan 16, 2012 at 1:25 PM, Andre Speelmans
> wrote:
>> On Mon, Jan 16, 2012 at 8:55 PM, JD wrote:
>>> What exactly were you trying to accom
Sorry about that. I meant to say that using for line in $(cat file) is bad
because it might not split up into lines properly.
- Original Message -
From: "JD"
To: "Community support for Fedora users"
Sent: Monday, January 16, 2012 3:34:37 PM
Subject:
Andre Speelmans napsal(a):
>> You shouldn't rely on cat or for to read a file line by line, but instead do
>> this:
>>
>> while read line; do
>> commands
>> done < hosts
>
> I would pick this form myself, but why should one not rely on cat? It
> seems to me a viable (even if useless use of cat)
On Mon, Jan 16, 2012 at 09:25:30PM +0100, Andre Speelmans wrote:
> I was not trying, the OP had a script that did a:
> cat file | while read line; do something done
>
> Matthew commented that you should not rely on cat for reading a file
> line by line and I was curious as to why not. ...
I'm not
On 16Jan2012 19:57, Hiisi wrote:
| On 16 January 2012 20:50, Kevin Martin wrote:
| > put a 'set -x' in there so you can see what's happening during the
execution. It would be interesting to know what $line is getting
| > set to. You may be surprised.
| >
| > Kevin
|
| Thanks for you help, Kev
On Mon, Jan 16, 2012 at 1:25 PM, Andre Speelmans wrote:
> On Mon, Jan 16, 2012 at 8:55 PM, JD wrote:
>> What exactly were you trying to accomplish using cat?
>
> I was not trying, the OP had a script that did a:
> cat file | while read line; do something done
>
> Matthew commented that you should
On Mon, Jan 16, 2012 at 8:55 PM, JD wrote:
> What exactly were you trying to accomplish using cat?
I was not trying, the OP had a script that did a:
cat file | while read line; do something done
Matthew commented that you should not rely on cat for reading a file
line by line and I was curious a
On Mon, Jan 16, 2012 at 11:27 AM, Andre Speelmans wrote:
>> You shouldn't rely on cat or for to read a file line by line, but instead do
>> this:
>>
>> while read line; do
>> commands
>> done < hosts
>
> I would pick this form myself, but why should one not rely on cat? It
> seems to me a viable
> You shouldn't rely on cat or for to read a file line by line, but instead do
> this:
>
> while read line; do
> commands
> done < hosts
I would pick this form myself, but why should one not rely on cat? It
seems to me a viable (even if useless use of cat) option.
Is there something totally wron
: Monday, January 16, 2012 12:08:45 PM
Subject: Re: OT: bash script - unexpected exit
Never mind. I changed it to use for line in `cat hosts` and now it works.
Sorry for the noise, list. Thanks for the tip, Kevin. That was fast!
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe
On 16 January 2012 20:57, Hiisi wrote:
> On 16 January 2012 20:50, Kevin Martin wrote:
>> put a 'set -x' in there so you can see what's happening during the
>> execution. It would be interesting to know what $line is getting
>> set to. You may be surprised.
>>
>> Kevin
>
> Thanks for you help,
On 16 January 2012 20:50, Kevin Martin wrote:
> put a 'set -x' in there so you can see what's happening during the execution.
> It would be interesting to know what $line is getting
> set to. You may be surprised.
>
> Kevin
Thanks for you help, Kevin. It doesn't display anything during first
l
On 01/16/2012 10:29 AM, Hiisi wrote:
> Hi, list.
> Sorry for OT. I like this list and really appreciate your help. Please
> excuse me if this post irritates you.
> I want to write a bash script that will do some work on a LAN. Here's
> the script (at least I execute it on Fedora machine ):
> #!/b
Hi, list.
Sorry for OT. I like this list and really appreciate your help. Please
excuse me if this post irritates you.
I want to write a bash script that will do some work on a LAN. Here's
the script (at least I execute it on Fedora machine ):
#!/bin/sh
set -e
cat hosts | while read line
do
14 matches
Mail list logo