![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix Arithmatic operation issue , datatype issue | thambi | Shell Programming and Scripting | 23 | 02-19-2008 04:19 AM |
| ftp issue | ravi raj kumar | Shell Programming and Scripting | 5 | 02-06-2008 05:24 AM |
| awk issue on AIX | ranj@chn | Shell Programming and Scripting | 1 | 07-04-2007 03:22 AM |
| Issue with rsh | sriram.s | AIX | 5 | 07-03-2007 08:37 AM |
| FTP issue | u263066 | Shell Programming and Scripting | 1 | 07-28-2006 03:18 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sh and csh issue
Hi
I like to assign a command string to a variable to execute. In this case, set sshexec_parent_pid="ps -ef | grep $$ | awk '/bash -c/ {print $3}' | sort | head -1;`" echo $sshexec_parent_pid ; But I can't seem to get it to work. It gives me sshexec_parent_pid: Undefined variable. Originally, my sh looks like this and this works sshexec_parent_pid=`ps -ef | grep $$| awk '/bash -c/ {print $3}' | sort | head -1;` export sshexec_parent_pid ; echo $sshexec_parent_pid ; Does anyone know how to do that in csh ? Advance thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
why is there a backtik at the end of this line before the last double-quote?
set sshexec_parent_pid="ps -ef | grep $$ | awk '/bash -c/ {print $3}' | sort | head -1;`" could that be causing a problem if it is in your real code? |
|
#3
|
||||
|
||||
|
Use eval to delay sbustitution of commands
Code:
$ test='\`echo "test worked"\`' $ echo $test \`echo "test worked"\` $ test='echo "test worked"' $ eval $test test worked $ |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|