Dear all
I'm not able to get the correct result form the following script
###########
#!/bin/sh
procs='ps -ef'
head='echo "$procs" | line'
echo "$head"
#############
Please advise
Best Regards
GY.
I'm not able to get the correct result form the following script
###########
#!/bin/sh
procs='ps -ef'
head='echo "$procs" | line'
echo "$head"
#############
Please advise
Best Regards
GY.
> Dear all
> I'm not able to get the correct result form the following script
> ###########
> #!/bin/sh
> procs='ps -ef'
> head='echo "$procs" | line'
> echo "$head"
> #############
> Please advise
> Best Regards
> GY.
echo "$procs" | lineQuote:> echo "$head"
Obviously youre yousing the wrong quote "'" is used to escape a string
from shellexpantion, not really, what you intended to do.
Use "`" instead and itll work.
Or even better use $( command ) instead because it also allows nesting
commands.
HTH, Ralf.
--
- Intraplan Consult Gmbh Orleansplatz 5a 81667 Muenchen +49 89 45911-0 -
... you start off with a typical message, let's say a 2.5MB Word document
containing three lines of text and a macro virus ... -- Peter Gutmann
You need to use the backticks, "`", instead of the forward ticks, "'",
to execute the commands.
#!/bin/sh
procs=`ps -ef`
head=`echo $procs | line`
echo $head
Thanks,
Eric
Quote:> Dear all
> I'm not able to get the correct result form the following script
> ###########
> #!/bin/sh
> procs='ps -ef'
> head='echo "$procs" | line'
> echo "$head"
> #############
> Please advise
> Best Regards
> GY.
`ps -ef` not 'ps -ef'; `echo "$procs" | line` not 'echo "$procs" | line'
Chris Mattern
Chris Mattern
> Dear all
> I'm not able to get the correct result form the following script
> ###########
> #!/bin/sh
> procs='ps -ef'
> head='echo "$procs" | line'
> echo "$head"
> #############
> Please advise
> Best Regards
> GY.
- Alex
1. Wrong major or minor number --but it's wrong
2. share disk array without software lock control
3. mount: wrong fs type,... What's wrong?
4. communication between two unix machines ?
5. What's wrong with 'file protocol' or 'http://localhost protocol'?
6. PLEASE HELP!! CD-rom troubles
7. 'df' and 'du' show wrong sizes
9. External 'time_t' variable 'altzone' seems to be wrong !
11. What's wrong when 'libc internal error: _rmutex_unlock: rmutex not held'
12. What's wrong with 'Bootlin'
13. can't figure out what's wrong with this script...