df command for listing 90% + dirs and hostname condition

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support df command for listing 90% + dirs and hostname condition
# 8  
Old 02-14-2012
Use backslashes ..
Code:
$ ssh user@servername "a=\$(hostname); echo \$a"
servername
$

This User Gave Thanks to jayan_jay For This Post:
# 9  
Old 02-14-2012
getting error sh: syntax error at line 1: `a=$' unexpected

Quote:
Originally Posted by jayan_jay
Use backslashes ..
Code:
$ ssh user@servername "a=\$(hostname); echo \$a"
servername
$

# 10  
Old 02-14-2012
try this...
Code:
 
ssh user@servername 'a=5; echo "value of $a"'

why dont you put the script in the destination server and invoke it from the ssh ?

Code:
ssh user@server "sh /path/of/remote/server/script.sh"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Looking for command line to find dirs based on size and date

Hi, My first time on this site, please excuse me if I've come to the wrong forum. I'm fairly new to Unix/Linux and hoping you can help me out. I'm looking for a command line that will return a list of directories that are larger than 50M and older than 2 days. I thought it may be... (6 Replies)
Discussion started by: Wisconsingal
6 Replies

2. Shell Programming and Scripting

if condition to check the hostname (unix)

I want to know the if condition in checking the hostname in unix and then running a cron job (all in a single line) Thanks (2 Replies)
Discussion started by: prash358
2 Replies

3. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

4. UNIX Desktop Questions & Answers

hostname in command prompt

Hello, all. Running 11.04. Is there a way that, in an ssh or telnet session, that hostname will not appear in the command prompt? Not logged in yet, so not seeking a user shell environment. I just want to see something like 'login>', not 'ubuntu login>'. ---------- Post updated at 07:50 PM... (3 Replies)
Discussion started by: mfearer
3 Replies

5. Red Hat

Hostname command issue

Hi All, I am using redhat Linux 5.2.2 on vmware. I have created VM Machine using kickstart & rest 10 machines i created using vmware cloning. On the base machine which i installed from kickstart its showing FQDN using hostname --fqdn but cloned machines are showing hosts name i have chnaged... (1 Reply)
Discussion started by: ajaincv
1 Replies

6. UNIX for Dummies Questions & Answers

**HELP** how to do a listing of dirs and all sub dirs only

I am trying to get a listing of ALL directories only under /export (as an example). I can get all the dirs directly under /export but I need any sub dirs under those dirs. I've looked (here and google) but can not find anything that works (4 Replies)
Discussion started by: bbraml
4 Replies

7. Shell Programming and Scripting

Not correct processing of “\ “ in names of dirs inside shell script (tar command - system backup scr

Hello, Recently, I've started with shell scripting, and decided to write a script for my system backup using tar. When I was dealing with tar execution inside shell script I found this, inside shell we have the following code: tar $TAR_PARAMS $ARCHIVE_FILE $EXCLUDE $BACKUP_STARTwith... (6 Replies)
Discussion started by: ilnar
6 Replies

8. AIX

Command last displays wrong hostname

I faced an interesting problem on my AIX servers. When I checked last logins with command last I saw that hostnames are wrong. Let say, I made login from workstation xxxxx and with the command last I saw: root pts/2 yyyyy 5 jan 15:38 still logged in Ping xxxxx and ping... (3 Replies)
Discussion started by: giovanni
3 Replies

9. Shell Programming and Scripting

Find command and pruning .dirs

I'm sure this has been asked before but I couldn't find it with the search. I have a script that looks for files and then moves to another location for further processing. My problem is I can't seem to prune the .s* directories. It doesn't break anything just wanted a cleaner process. Here... (4 Replies)
Discussion started by: jcalisi
4 Replies

10. Solaris

How to display hostname in command prompt

Anyone know How to configure solaris 8 to display hostname in command prompt , everytime when you open a terminal screen . (3 Replies)
Discussion started by: civic2005
3 Replies
Login or Register to Ask a Question