Nested Echo Command Help

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Nested Echo Command Help
# 1  
Old 09-16-2007
Nested Echo Command Help

I am doing below :



$echo $HOST_NAME1 $count
webisstg70 1


$HOST_NAME=`echo '$HOST_NAME'${count}`

$echo $HOST_NAME

$NODE_NAME=`echo $`echo ${HOST_NAME}``

I get below error message

ksh: HOST_NAME1: not found

Could anyone please help me in identifying reason for error message. I am trying to first echo value of $HOST_NAME which itself is a variable (HOST_NAME1) so I am again echoing value of HOST_NAME1 variable to NODE_NAME variable.
# 2  
Old 09-16-2007
Originally Posted by findprakash
$NODE_NAME=`echo $`echo ${HOST_NAME}``
You may find 'eval' more useful.
# 3  
Old 09-22-2007
Nested Echo Command Help

Thanks it works
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

The Shell lost the inverted comma in a nested ssh command

Hi, i want use this Comand for my psql request sh ssh -o StrictHostKeyChecking=no sudo psql -U postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datnam=\'$DB\';"'" but the shell lost the inverted comma for datnam=\'$DB\'. The request deliver... (2 Replies)
Discussion started by: peterpane007
2 Replies

2. Shell Programming and Scripting

Nested case: rsync command not found

Hello! Below my first bash script. As you can see i build 2 nested cases. The second one (sync databases) is working fine. Bu the first one (sync datadirs) is not working. It says: rsync: command not found. However when i move the rsync command to the top of the script its working. So i suppose... (2 Replies)
Discussion started by: hyperconnected
2 Replies

3. Shell Programming and Scripting

Need to echo command successful if command is executed successfully

Hello, I have written a command n shell script : srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f If the above command executes successfully without error I need to echo "Service relocated successfully and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

4. Shell Programming and Scripting

Using shell command need to parse multiple nested tag value of a XML file

I have this XML file - <gp> <mms>1110012</mms> <tg>988</tg> <mm>LongTime</mm> <lv> <lkid>StartEle=ONE, Desti = Motion</lkid> <kk>12</kk> </lv> <lv> <lkid>StartEle=ONE, Source = Velocity</lkid> <kk>2</kk> </lv> <lv> ... (3 Replies)
Discussion started by: NeedASolution
3 Replies

5. Shell Programming and Scripting

How can I write nested command substitutions?

Hello How can write the nested command substitutions? echo `expr substr $x 1 expr ${#x} - 1` the above code is not working! Thanks in advance Regards Chetanz (5 Replies)
Discussion started by: Chetanz
5 Replies

6. UNIX for Dummies Questions & Answers

Help me with Echo Command

Hi All I have the big statement which needs to be appended to the file MANUALLY without opening the file. So, i tried with echo command echo " failure ( 4446): for host trying to GET /index.html, wl-proxy reports: exception occurred for backend host '':... (11 Replies)
Discussion started by: Kalaiela
11 Replies

7. Shell Programming and Scripting

Echo Command Help

Hi All I want to use the echo command to had some lines to a file but the lines i want to have contain " and ; here is my command system("echo user_pref("accessibility.typeaheadfind.flashBar", 0); > $profile"); but i think there are too many " and so it barfs n e ideas thanks A (5 Replies)
Discussion started by: ab52
5 Replies

8. Shell Programming and Scripting

What does following echo command do?

Can anybody tell me what does following command do? # echo gsoc1 | ./ Regards, akash mahakode (1 Reply)
Discussion started by: akash_mahakode
1 Replies

9. UNIX for Dummies Questions & Answers

Echo command with $$ $# $@

Hi, Good morning. Would you please explain to me what does it mean by the following command. echo "$$ $# $@" >> /opt/ftp_generic_send.log I know that something is being directed to log file, but not sure what exactly mean by those $$ and $# and $@ means. Thank you for your help.... (3 Replies)
Discussion started by: howdy
3 Replies

10. Shell Programming and Scripting

Nested Loop to Echo Multiple Arrays

I have three arrays which hold three elements each. I have a fourth array which contains the names of those three arrays. I'm having difficulty creating a nested loop that can loop through each array and echo their values. script #!/bin/ksh # array of locations (usa, london, australia)... (1 Reply)
Discussion started by: yongho
1 Replies
Login or Register to Ask a Question