I'm trying to use Here documents to pass several commands to a remote server over SSH. However I'm having problems. The code is as follows:
The problem seems to start with the fact that the "proc" variable does not seem to set correctly. I thought you could include $() for sub-shells via EOF docs? Any ideas anyone?
Hi :)
how can I use here doc to use ssh?
I am facing a problem with the below script:
#!/bin/bash
ssh hosein@localhost << *
123456
*
"123456" is my password
Thanks (2 Replies)
Can we use a here document inside a here document?
Something like this
ssh user@remotehost << REMOTE
sudo vserver vsernamename enter << VSERVER
perform actions on vserver.
VSERVER
REMOTE (6 Replies)
Help please!!
I want to use ssh to execute a remote exe and while it's running I want to query for the process ID of the exe (2 different ssh commands)
1. sshpass -p "<passwd>" ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@<ipaddress> nohup /tmp/mmds_asyn &
2.... (0 Replies)
Hello. I was wondering if someone can help me out with something. To simplify my life, I have written a tiny script to open an ssh tunnel through another linux host so that I can access the esxi hosts on that network using the client. For this I have to tunnel ports 443, 902, and 903. Here is what... (1 Reply)
Hello,
I am trying to find a way to send several sequential commands via SSH to a remote box in a single command.
Thoughts so far:
1) Can I put them into a function and call the function within the ssh command?
e.g.
ssh <targetserver> $(functionx)
No - then it calls the function in... (4 Replies)
I'm trying to write a foreground (password prompt) ssh command, passing in a here doc - any idea where I'm going wrong?
ssh <user>@<targetserver> /usr/seos/bin/sesu - <targuser> -c /usr/bin/ksh "param1" << EOF
date
echo ${1}
EOF
Tells me "Invalid option param1". However a simple date... (8 Replies)
I try to ssh uses bash script in here-document like this.
ssh root@$SERVER <<EOF
if ; then
service httpd start
fi
exit
EOF
But got an error below.
maybe the if command causes the problem. Thanks for help. (2 Replies)
Hi,
I am trying to execute an ssh command in my script.
ssh abcd@server_name
After this command it actually logs in to the server asking for password prompt and then actually logs in to the server.
I want all this to be happening in the background and show noithing in the output of my... (8 Replies)
Greetings, i've been working with a user-friendly menu on ksh to allow users execute scripts located on a remote server, so they wont have to login and manually launch those scripts every single time.
This is a HP-UX box and currently on a /usr/bin/ksh shell.
I've setup ssh keys on both... (1 Reply)
I am trying to run a command. This is one of my attempts:
for i in fileservera; do ssh -t $i 'sudo ls /';doneThis works, and I see the directories. However, what I want to do now is start a process on the remote server such as /usr/bin/connectproc -standalonesudo /usr/bin/connectproc... (1 Reply)
Discussion started by: newbie2010
1 Replies
LEARN ABOUT V7
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)