10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I read a file (iplist.txt) ine-by-line in a loop which has the list of all the server hostnames.
With each hostname read; I do ssh and fire multiple commands to gather information about that systemas shown below.
#!/bin/bash
while IFS='' read -r line || ]; do
echo "Text read from file:... (3 Replies)
Discussion started by: mohtashims
3 Replies
2. AIX
Hi,
I am having a file like,
#cat file
Jun 19 13:08
Jun 19 13:08
Jun 19 13:08
Jun 19 13:14
when I run the below comamnd locally it will work fine,
IFS=$'\n'; for i in $(cat file) ;do echo "HI $i" ; done
And the output is,
HI Jun 19 13:08
HI Jun 19 13:08
HI Jun 19 13:08
HI... (1 Reply)
Discussion started by: sumanthupar
1 Replies
3. Shell Programming and Scripting
I have written the following script to update some Debian boxes.
#!/bin/bash
mxg_hosts_file="/etc/mxg/ssh-hosts"
while read line ; do
mxg_host="$(echo ${line} | awk -F":" '{print $1}')"
mxg_port="$(echo ${line} | awk -F":" '{print $2}')"
echo "Connecting and Upgrading... (3 Replies)
Discussion started by: jelloir
3 Replies
4. UNIX for Dummies Questions & Answers
my ksh script is not working...
i wanna remove lines in file2.txt from file1.txt
# cat file1.txt
this is line one
this is line two
this is line three
this is line four
this is line five
# cat file2.txt
this is line two
this is line three
# cat my_script.ksh
#!/bin/ksh
i=1
y=1... (8 Replies)
Discussion started by: curtis911
8 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I am facing an issue while trying to access a for loop variable inside ssh. Can anyone please help me with what this issue is, the following is the code that I have ->
IMPL_LOG_FOLDERS=(transaction_logs invalid_transaction_logs)
sshg3 ftp_id@boxname << EOS
for log_folder in... (5 Replies)
Discussion started by: anindyabecs
5 Replies
6. Shell Programming and Scripting
Hi
I am working on a server that is set up and maintained by a third party. It seems whenever I run bash scripts in the background (with a &) with while loops in them they seem to me killed in around 2.5 hours. ( I am running them as a normal user with no special privileges ) . Is there a... (3 Replies)
Discussion started by: pkabali
3 Replies
7. Shell Programming and Scripting
Hi,
The requirement is to ssh to unix servers and oracle databases, to perform some monitoring activity. I'm using shell script to perfom this.
I pass the server details and database to a variable ...
SERVERS="SERVER1 SERVER2 SERVER3"
DATABASE="DB1 DB2 DB3"
for i in $SERVERS
do
ssh... (2 Replies)
Discussion started by: senthil3d
2 Replies
8. UNIX for Advanced & Expert Users
Hey guys,
I was using ssh-keygen settings for a long time to login on remote machines without password.
2 days back it suddenly stops working, i tried by reset all ssh-keygen setting but it not works.
what could be the reason of this issue and how can i resolve this? (2 Replies)
Discussion started by: RohitKJ
2 Replies
9. Shell Programming and Scripting
How do you do an ssh on a for statement. I have done ssh on individula lines of code before with no problems.
#!/usr/bin/ksh
cat server_list.txt | while read line
do
ssh $line "for i in `lslpp -l |grep tsm`
do
lslpp -Lc $i |grep -v State |tr ':' ',' |awk -F, '{print $2, "," ,... (4 Replies)
Discussion started by: din
4 Replies
10. Shell Programming and Scripting
Hi all,
I am trying to run a script which is expected to do:
on the remote machine,
There are two directories /export/home/abc1,/export/home/abc2
i am trying to do,
ssh SERVERNAME "for i in `ls -l /export/home/abc*|awk '{print $9}'`; do cd $i; ls -l; done"
But its not working ,iam... (11 Replies)
Discussion started by: Jartan
11 Replies