Linked Questions

0
votes
1answer
4k views

Why “lsof” is not working when it used in ssh? [duplicate]

I found this command line is not working ssh i01n10 "/usr/sbin/lsof -p $(pgrep -nf a.out)" it shows the error lsof: no process ID specified However ssh i01n10 "$(pgrep -nf a.out)" correctly ...
0
votes
1answer
739 views

Quotes exercise - how to do ssh inside ssh whilst running sql inside second ssh? [duplicate]

Possible Duplicate: Quoting in ssh $host $FOO and ssh $host “sudo su user -c $FOO” type constructs Wrapping a command that includes single and double quotes for another command I want to run ...
0
votes
1answer
298 views

Syntax Error while running command from another hosts [duplicate]

I run a command to fetch server uptime as below [root@localhosts ~]# printf "`uname -n` `uptime| awk -F " " {'print $3,$4'}`\n" localhosts 75 days, Now when I run same command from another ...
0
votes
1answer
77 views

Why the number is rounded over ssh? [duplicate]

localhost:~ $ df -k / | awk '{print $3/1024/1024/1024}' 0 0.00618061 localhost:~ $ ssh localhost "df -k / | awk '{print $3/1024/1024/1024}'" 01 01
0
votes
0answers
45 views

Is it possible to ssh and execute a remote command with a single quote in it? [duplicate]

ssh user@host "mv \"/some/path/fi\'le.txt\" /some/new/path" It doesn't matter what I do, or what combination of quotes I use on the file, it gives the following: bash: -c: line 0: unexpected EOF ...
0
votes
1answer
41 views

Why mkdir with ssh doesn't want create longname dir? [duplicate]

Two slackware 14.2 systems,ssh is 7.9p1. On local system mkdir -p -v "I want to create long dir name with spaces" mkdir: directory 'I want to create long dir name with spaces' created And is OK On ...
3
votes
4answers
1k views

Piping paths with different types of quotes for slash substitution

I would like to use sed to convert a path with backslashes to the same path with forward slashes: E.g. I would like to pipe \\path\to\file\ and obtain /path/to/file None of the following commands ...
2
votes
1answer
249 views

BASH subprocess using SSH in script?

I want to do something like the following in a script $ ssh host1 "$(command)" However, the sub processes gets executed before the SSH connection is established because if I do the following $ ssh ...
0
votes
1answer
195 views

How to avoid quoting and escaping needed when passing commands and local variables to ssh with sudo?

How to avoid quoting and escaping needed when passing commands and local variables to ssh with sudo? Found someone providing a creative way to avoid quoting by using here-documents. It sounded like a ...
0
votes
1answer
206 views

sed + remove string on remote machine

please advice what is wrong with my sed syntax ? ssh postgres@172.34.5.76 sed -i '/archive_command/ s/#BARMAN#[ ]*//g' /var/lib/pgsql/data/postgresql.conf" sed: -e expression #1, char 17: missing ...