Re: awk or sed

2011-04-22 Thread ali hagigat
I have a makefile and I want to print each word of the variable, .VARIABLES on a separate line. This is the content of .VARIABLES: .VARIABLES=wrote: > On Wed, 6 Apr 2011, ali hagigat wrote: > > I have a variable like this: >> var1=Makefile .xcompile /root/build/.confi

Re: multi line bash commands in a Makefile

2011-04-10 Thread ali hagigat
Thanks Clark for the reply. 'count' is set by shell before doing make. like root> count=0 On Sun, Apr 10, 2011 at 3:10 PM, Clark J. Wang wrote: > On Sun, Apr 10, 2011 at 6:17 PM, ali hagigat wrote: >> >> How can i specify a multi line shell instruction as a recipe?

multi line bash commands in a Makefile

2011-04-10 Thread ali hagigat
How can i specify a multi line shell instruction as a recipe? The following returns an error: makefile27: e14: @echo var1=$(var1) makefile25: include makefile27 e12: @echo insidee12 makefile27: e13 if ( test $$count -eq 0) then echo "all: ;echo ppp" > makefile27;count=1;f

Re: awk or sed

2011-04-05 Thread ali hagigat
Very nice . It worked. I want to study your book. Thank you. Regards On Wed, Apr 6, 2011 at 7:47 AM, Chris F.A. Johnson wrote: > On Wed, 6 Apr 2011, ali hagigat wrote: > >> I have a variable like this: >> var1=Makefile .xcompile /root/build/.config src/arch/i386/Makefile.inc &

awk or sed

2011-04-05 Thread ali hagigat
I have a variable like this: var1=Makefile .xcompile /root/build/.config src/arch/i386/Makefile.inc means some words separated by spaces. I want to print each word on a separate line. I think I have to use "awk" or "sed" string processing tools. I wonder if anybody have experience with them or any

When double quote is considered when not?

2011-03-30 Thread ali hagigat
The following scripts were run for /bin/bash, version 4.0.33, and then comes their outputs. In the second example seems to have a warning: "binary operator expected". Why the error is generated? and why there is no error for the first example? -- var1="word1 word

How can i specify the scripting language used for parsing a script?

2011-02-05 Thread ali hagigat
#!/bin/sh echo ppp echo $SHELL exit 2200 In the above script i tried to specify /bin/sh as my parser by a comment. Is that OK? When I type ./scr2 , i want bash recognize /bin/sh as the parser of ./scr2.

Why sh does not return a false value?

2011-02-05 Thread ali hagigat
if (sh -c exit 34) then echo p;fi p The following condition should be false, because our exit value is non-zero. but 'if' considers the condition as true and executes 'echo' command. Why?

How to echo the return value of a program

2011-01-22 Thread ali hagigat
I want to print the return value of an executable like: make -q -f makefile22 The above command returns non-zero if the targets are not up to date. How can i see that value by shell commands. I am using /bin/bash, Fedora gnome-terminal.

question about exit command

2011-01-19 Thread ali hagigat
I have two script files and I execute them as follows: - #script1 echo ppp exit 0 echo qqq /root> ./script1 ppp - #script2 if (exit 0) then echo ppp fi /root> ./script2 ppp - In script1,

Re: how to escape single quote?

2010-12-29 Thread ali hagigat
Dennis, Nice. Much appreciated What logic is it using you think when we use echo 'ppp'\''qqq'? Why echo 'ppp\'qqq' is not OK? It can not escape single quote by \ ! On Wed, Dec 29, 2010 at 1:11 PM, Dennis Williamson wrote: > On Wed, Dec 29, 2010 at

how to escape single quote?

2010-12-28 Thread ali hagigat
I wonder if anybody knows how to escape a single quote character by /bin/sh or bash? echo 'ppp\'qqq'' ppp\qqq Please look at the above example and the result. Regards