LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2010, 12:45 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
doing a sequence of commands in a bash script.


Hi,

I'm creating a bash script that contains the following line:
"ssh user@$server1 cd /tmp; pwd"

What I want is to print /tmp of server1, but the script it isn't printing that.

How can I do that in the script?

Thanks,
 
Old 12-02-2010, 12:47 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Change
Code:
"ssh user@$server1 cd /tmp; pwd"
to
Code:
ssh user@$server1 "cd /tmp; pwd"
 
1 members found this post helpful.
Old 12-02-2010, 12:49 PM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
thanks, 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
echo commands in BASH script to STDOUT tospo Programming 9 11-03-2010 11:12 AM
[SOLVED] My simple bash script is not running all of the commands Subject16 Programming 5 06-14-2010 11:17 AM
bash script to run commands dormant Programming 1 08-25-2009 02:35 PM
commands behind a bash here script onurbi Linux - Software 3 11-14-2003 08:38 AM
Using vi commands in a bash script tiger Programming 1 05-21-2001 06:08 PM


All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration