LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   syntax (https://www.linuxquestions.org/questions/linux-newbie-8/syntax-4175506886/)

ashley75 06-03-2014 08:39 AM

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`"

linosaurusroot 06-03-2014 08:53 AM

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.

smallpond 06-03-2014 09:05 AM

The backticks look like a mistake. What are they for?

ashley75 06-03-2014 09:06 AM

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?

ashley75 06-03-2014 09:17 AM

thanks remove the `` did the trick

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

Shadow_7 06-03-2014 10:58 AM

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


All times are GMT -5. The time now is 03:28 PM.