LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-25-2009, 11:31 PM   #1
manya
Member
 
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
Challenge in Bash script with read variable


Hey Guys,

Hope this is the correct thread to address Bash Script issue.

I am facing challenge in bash script, where I am executing certain users submitted parameters via ssh command on remote machine. but since remote machine is nokia firewall and session is remote ssh I am not able to pass the same command.

e.g.
##########################
echo "Give me Firewall Name: "
read fw_name
echo "IP address or Network that you want to check in route table"
read rte

ssh user@$fw_name 'clish -c "show route destination $rte"'

###########################

Now whats happening here is since I am sshing into the server I am not able to pass $rte variable provided by client.

Please advise..
 
Old 07-26-2009, 02:43 AM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Try one of these:

ssh user@$fw_name "clish -c "show route destination $rte""
ssh user@$fw_name "clish -c \"show route destination $rte\""
 
Old 07-26-2009, 11:00 PM   #3
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
Hey Admiral...
Thanks man it worked ....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
Problem with bash script - variable name within variable name steven.c.banks Linux - Newbie 3 03-10-2009 03:08 AM
Bash Script Help - Trying to create a variable inside script when run. webaccounts Linux - Newbie 1 06-09-2008 02:40 PM
Bash read in variable length text records lynx81191 Programming 4 11-17-2007 08:53 PM
bash read files to variable question babag Programming 7 06-25-2007 05:04 AM


All times are GMT -5. The time now is 03:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration