Search Results

Search: Posts Made By: mbak
1,086
Posted By Don Cragun
Change first.ksh to: #!/bin/ksh !...
Change first.ksh to:
#!/bin/ksh
! /tmp/second.ksh && exit 1
rm /tmp/list
and change second.ksh to:
#!/bin/ksh

if [ -f /tmp/list ]
then echo "Found LIST..."
echo "Are these values correct:...
813
Posted By MadeInGermany
In the previous suggestion the two outer loops...
In the previous suggestion the two outer loops can be swapped, so lspv is run once.
The following suggestion does not run lspv at all:
for status in missing failed
do
lspath -s $status -F "name...
813
Posted By Scrutinizer
Noticed that variable names do not match: for...
Noticed that variable names do not match: for path vs. ${pathid}.
813
Posted By Ivo Breeden
Like this? #!/usr/bin/ksh for status in...
Like this?

#!/usr/bin/ksh
for status in missing failed
do
for disk in `lspv | awk '{print $1}'`
do
for path in `lspath -l ${disk} -s ${status} -F "name parent path_id connection" |...
1,876
Posted By apmcd47
This may work, assuming I understand your...
This may work, assuming I understand your requirements correctly.

Add the following lines to the start of your program:

err_code() {
mail -s "Problem with disk replacement" user@abc.com<...
1,876
Posted By hicksd8
So can't you test the exit status of the command...
So can't you test the exit status of the command to see if it's non-zero and, if so, email the log to yourself there and then?

I'm assuming that the RAID command obeys usual practice and gives...
2,619
Posted By rbatte1
The problem you have now is that there is no...
The problem you have now is that there is no error check that the change of directory worked.

Would running ./test.sh in the home directory cause a problem?

I would avoid the exec, there is...
2,619
Posted By Just Ice
your double quotes are wrong ...
if you look at the red-colored characters below, you will see that you have 2 groupings of "command arguments" with the '&&' operator in between.
ssh -l username@hostname "echo "( cd...
1,342
Posted By RudiC
I can't see a relation between the outputs of the...
I can't see a relation between the outputs of the two commands given in post#3 connected by the /tmp/input contents.
Why don't you take a step back, and rephrase your request including ALL data...
1,342
Posted By Don Cragun
Showing us an input file and non-working code...
Showing us an input file and non-working code without a clear explanation of what output you are trying to produce does't help a lot.

What does the lspv utility do? What output does it produce?
...
1,696
Posted By Scrutinizer
You could just call the script like this: echo...
You could just call the script like this:
echo YES | /path/to/script
1,696
Posted By MadeInGermany
Feeding two 'yes' echo 'yes yes' |...
Feeding two 'yes'
echo 'yes
yes' | /path/to/script
1,653
Posted By Don Cragun
Although untested, this would seem to be a more...
Although untested, this would seem to be a more efficient version of your latest script, producing the same outputs:
#!/bin/ksh
YEAR=$(date "+%Y")
cd /tmp

mkdir -p "${YEAR}_LOGS"

for i in...
8,067
Posted By MadeInGermany
That can shrink to lsdev -Cc disk | awk'/2810/...
That can shrink to
lsdev -Cc disk | awk'/2810/ {print$1}' > /tmp/list.outAnd if /tmp/list.out consists only of the disk names, then in the other part you can exclude them e.g. with
lspath | grep...
4,099
Posted By in2nix4life
If you're just testing to make sure your AIX box...
If you're just testing to make sure your AIX box sees the fibre cards, then this may help point you in the right direction:


#!/bin/ksh
set -x
COUNT=$(lsdev -Cc adapter | egrep -c -e 'fcs'...
4,099
Posted By methyl
The script by in2nix4life in post #3 appears to...
The script by in2nix4life in post #3 appears to be exactly what you need.
If you feel that you need to match on more than "fcs" I'm sure you can adapt the post.


Your original script was beyond...
3,342
Posted By ahamed101
push script had errors! push.ksh ...
push script had errors!

push.ksh

#!/bin/bash
uname -n

#what is this line supposed to do?
#echo "`ls -ltr awk 'NR!=1 && NR!=2 {print $5}'`

ls -l /jdfkds # to test fail condition

if [...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy