On 09.04.2010 16:50, Jasper wrote:
>
>
>> if I only execute one command on true/false conditions, I prefer:
>> command && react_true || react_false
>>
>
> Although this generally works it is not correct:
>
> If 'react_true' fails for some reason then 'react_false' is also executed.
>
> --Jaspe
> if I only execute one command on true/false conditions, I prefer:
> command && react_true || react_false
>
Although this generally works it is not correct:
If 'react_true' fails for some reason then 'react_false' is also executed.
--Jasper.
--
To UNSUBSCRIBE, email to debian-user-requ..
On 08.04.2010 14:58, Ron Johnson wrote:
> On 2010-04-08 03:01, Mart Frauenlob wrote:
>> On 07.04.2010 23:12, Ron Johnson wrote:
>>> On 2010-04-07 15:45, Mart Frauenlob wrote:
On 07.04.2010 22:10, Kent West wrote:
>>
>> [...]
>>
> I want a script that will read the file and look for the nam
On 2010-04-08 02:56, Mart Frauenlob wrote:
[snip]
2: saving me typing (quick web search):
http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2006-12/msg00934.html
Interesting.
--
"History does not long entrust the care of freedom to the weak
or the timid." Dwight Eisenhower
--
To UNSUBS
On 2010-04-08 03:01, Mart Frauenlob wrote:
On 07.04.2010 23:12, Ron Johnson wrote:
On 2010-04-07 15:45, Mart Frauenlob wrote:
On 07.04.2010 22:10, Kent West wrote:
[...]
I want a script that will read the file and look for the name "fred",
and if it's found, leave the file alone, but if it'
On 2010-04-08 03:03, Mart Frauenlob wrote:
On 08.04.2010 00:49, Ron Johnson wrote:
On 2010-04-07 16:12, Ron Johnson wrote:
[snip]
Mart's method is the shell way. The 3GL Way is:
grep -w "$NAME" "$FILE"
TMP=$?
if [ "$TMP" = "1" ];
That should be:
if [ "$TMP" = "0" ];
then
echo -e "$NAM
On 08.04.2010 00:49, Ron Johnson wrote:
> On 2010-04-07 16:12, Ron Johnson wrote:
> [snip]
>>
>> Mart's method is the shell way. The 3GL Way is:
>>
>> grep -w "$NAME" "$FILE"
>> TMP=$?
>> if [ "$TMP" = "1" ];
>
> That should be:
>
> if [ "$TMP" = "0" ];
>
>> then
>> echo -e "$NAME\n" >> "$F
On 07.04.2010 23:12, Ron Johnson wrote:
> On 2010-04-07 15:45, Mart Frauenlob wrote:
>> On 07.04.2010 22:10, Kent West wrote:
[...]
>>> I want a script that will read the file and look for the name "fred",
>>> and if it's found, leave the file alone, but if it's not found, to add
>>> the name "fr
On 07.04.2010 23:56, Eduardo M KALINOWSKI wrote:
> On 04/07/2010 05:45 PM, Mart Frauenlob wrote:
>>
>> #!/bin/sh
>> grep -w "fred" file || printf "%s\n" "fred">>file
>>
>>
>
> Why not simply use
> echo "fred" >> file
> for the second command?
>
>
1: I'm used to it.
2: saving me typing (qu
On 2010-04-07 16:12, Ron Johnson wrote:
[snip]
Mart's method is the shell way. The 3GL Way is:
grep -w "$NAME" "$FILE"
TMP=$?
if [ "$TMP" = "1" ];
That should be:
if [ "$TMP" = "0" ];
then
echo -e "$NAME\n" >> "$FILE"
fi
--
"History does not long entrust the care of freedom to th
On 04/07/2010 05:45 PM, Mart Frauenlob wrote:
#!/bin/sh
grep -w "fred" file || printf "%s\n" "fred">>file
Why not simply use
echo "fred" >> file
for the second command?
--
All men have the right to wait in line.
Eduardo M KALINOWSKI
edua...@kalinowski.com.br
--
To UNSUBSCRIBE, emai
On 2010-04-07 15:45, Mart Frauenlob wrote:
On 07.04.2010 22:10, Kent West wrote:
I'm asking you folks, 'cause y'all know this stuff (I've been wrestling
with this simple task all day).
I've got a text file; I just want a script (a one-liner sed or awk
command, etc, would be awesome) to check to
Mart Frauenlob wrote:
On 07.04.2010 22:10, Kent West wrote:
I'm asking you folks, 'cause y'all know this stuff (I've been wrestling
with this simple task all day).
I've got a text file; I just want a script (a one-liner sed or awk
command, etc, would be awesome) to check to see if the file c
On 07.04.2010 22:10, Kent West wrote:
> I'm asking you folks, 'cause y'all know this stuff (I've been wrestling
> with this simple task all day).
>
> I've got a text file; I just want a script (a one-liner sed or awk
> command, etc, would be awesome) to check to see if the file contains a
> certai
14 matches
Mail list logo