Linux / UNIX Tech Support Forum
This is a discussion on Pause script execution untill each line is complete within the Shell scripting forums, part of the Development/Scripting category; Hello, I need to run SERVERS="server1 server2...." for b in $SERVERS do echo $b; ssh $b grep 'abstract-photos.com' /etc/named.conf echo ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I need to run SERVERS="server1 server2...." for b in $SERVERS do echo $b; ssh $b grep 'abstract-photos.com' /etc/named.conf echo ""; done but before this need to add the ssh key: exec ssh-agent bash ssh-add /root/.ssh/my-key/ how can I include in the same script both so that when I run the script it prompts for the paraphrase and run the script? and kind of the same with an script that creates a user on the system /usr/sbin/useradd myuser passwd myuser mkdir ~/downloads cd ~/downloads wget... how to write this so it does not cut off when requesting for the password? Regards, Cosmin |
| Sponsored Links | ||
|
|
|
||||
|
You can either use sshpass to set password in script or use ssh keys for passwordless login:
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Thanks for the solution but rather than storing the pass better typeing it once before starting the script.
about this other thing: /usr/sbin/useradd myuser passwd myuser mkdir ~/downloads cd ~/downloads wget... how to write this so it does not cut off when requesting for the password? |
|
||||
|
Are you talking about wget password?
__________________
Vivek Gite Linux Evangelist |
|
|||
|
I want to create a script to install nagios addon on several machines.
but when pasting /usr/sbin/useradd myuser passwd myuser mkdir ~/downloads cd ~/downloads wget http://surfnet.dl.sourceforge.net/sourceforge/ wget http://surfnet.dl.sourceforge.net/sourceforge/ tar xzf nagios tar xzf nagios ...................... it shows all this and prompts for the pass , after entering the pass it does not complete the rest.. mkdir ~/downloads cd ~/downloads wget http://surfnet.dl.sourceforge.net/sourceforge/ wget http://surfnet.dl.sourceforge.net/sourceforge/ tar xzf nagios tar xzf nagios ...................... can it be somehow that I paste the block of code and it is beeing procesed line by line? and wait for user input where it is needed. |
![]() |
| Tags |
| password , shell script , shell scripting , ssh |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HPUX Unix comparing 2 large files line by line | raj | HP-UX | 1 | 11-02-2008 05:20 PM |
| Complete NOOB need help | gham | Shell scripting | 0 | 04-06-2007 09:56 PM |
| Omit the first line in a file | c341 | Shell scripting | 4 | 29-12-2006 02:07 PM |
| speeding up execution | kavi | Linux software | 6 | 16-10-2005 04:31 PM |