Hi
I use the following command to check if my_base is active or not :
active_db=`${LOCAL_BIN}/ssh -l ${my_user} ${my_service} "ps -ef | grep ora_smon | grep ${my_base} | sed -e \"s/ */ /g\" | cut -d'?' -f2 | cut -d' ' -f3 | cut -d'_' -f3"`
When I use a file listing databases to check them... (1 Reply)
The while loop exits (early) when a simple ssh command is run.
#!/bin/ksh
#set -x
#-------------------------------------------------------------------------
# Functions Section
#-------------------------------------------------------------------------
while :
do
cat list.txt|while read... (1 Reply)
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)
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)
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)
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)
Here is the smallest extract to demonstrate the problem that I experience.
#!/bin/bash
r=$1
while read ip
do
if ] ;then
x=`ssh $ip echo "$ip"`
else
x=`echo "$ip"`
fi
echo $x
done << EOF
192.168.8.241
192.168.8.241
EOF
# Any IP with public key set (0 Replies)
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)
Hi, I use ubuntu 16.04 desktop with ufw (default setup + 22, 80, 443 ports open).
I connect directly to ISP using pppoe over eth0. I also have eth1 which when disabled the websites are accessible in browser. When starting eth1 with auto dhcp the websites are no longer accessible in browser (give... (3 Replies)
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
LEARN ABOUT HPUX
break
break(1) User Commands break(1)NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop
SYNOPSIS
sh
break [n]
continue [n]
csh
break
continue
ksh
*break [n]
*continue [n]
DESCRIPTION
sh
The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels.
The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop.
csh
The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current
line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line.
The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop.
ksh
The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is
greater than the number of enclosing loops, the outermost enclosing loop shall be exited.
The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n-
th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera-
tion are not performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), exit(1), ksh(1), sh( 1), attributes(5)SunOS 5.10 17 Jul 2002 break(1)