Computing.Net > Forums > Unix > assign two commands to a variable.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

assign two commands to a variable.

Reply to Message Icon

Name: Najib (by Nael_Najib)
Date: August 25, 2007 at 23:04:08 Pacific
OS: Solaris
CPU/Ram: Sun Sparc /8Gb RAM
Product: Sun
Comment:

Hello,

I have a problem assigning two commands into one variable. i did the following

CHK=`cat `cat $HOM/temp.log``
$CHK

and i did:

CHK="cat `cat $HOM/temp.log`"
${CHK}

but it is not working.. do you have any idea how to make it work.

Thanks

Aladimi



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: August 27, 2007 at 09:31:14 Pacific
Reply:

A way ....

#!/bin/ksh

STR='eval "cat `cat temp.log`"'
CHK=`eval $STR`
echo $CHK


0
Reply to Message Icon

Related Posts

See More


Need help creating an out... Unix File/String Manipula...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: assign two commands to a variable.

Prob Assign Row count to a variable www.computing.net/answers/unix/prob-assign-row-count-to-a-variable/7875.html

Assign to a Variable www.computing.net/answers/unix/assign-to-a-variable/4408.html

assigning a variable to a script www.computing.net/answers/unix/assigning-a-variable-to-a-script/5566.html