LinuxQuestions.org
Help answer threads with 0 replies.
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 06-03-2014, 08:39 AM   #1
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Rep: Reputation: 30
syntax


Hi all,

I need to ssh to the remote server and run the ps command, below is the command I have issue, can you please advise?

ssh servername "hostname; `ps -L -U oracle|grep java |wc -l`"
 
Old 06-03-2014, 08:53 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
It looks as if you have done
Quote:
ssh to the remote server and run the ps command
.

Your question does not explain why you have not found your command satisfactory now how you chose those details for the command.
 
Old 06-03-2014, 09:05 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,775

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
The backticks look like a mistake. What are they for?
 
Old 06-03-2014, 09:06 AM   #4
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
basically on one command I would like to do three things: ssh to the remote server, get the host name and run the count on oracle with java process

is it possible?
 
Old 06-03-2014, 09:17 AM   #5
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
thanks remove the `` did the trick

what would be equivalent syntax of -L and -U on Solaris?

Last edited by ashley75; 06-03-2014 at 09:44 AM.
 
Old 06-03-2014, 10:58 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,070
Blog Entries: 1

Rep: Reputation: 668Reputation: 668Reputation: 668Reputation: 668Reputation: 668Reputation: 668
The `` is for execution of the contents between the ``. The $() is the more modern bash equivalent.

$ export TEMP=`echo "hello"`
$ echo $TEMP

same as

$ export TEMP=$(echo "hello")
$ echo $TEMP
 
  


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
as: using Intel syntax (as opposed to AT&T syntax). stf92 Programming 2 04-19-2014 10:25 PM
VIM syntax highlighting: Use of AWK syntax inside shell scripts kaiserkarl13 Programming 0 11-13-2012 10:04 AM
[python] syntax Error : invalid syntax Python_user Programming 2 09-06-2009 12:52 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 AM.

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