Hello all,
i am new to AIX and have a hard time with dsh.
At a customers site we have about 30 LPARs and I want to create a formatted list of available space in volume groups for all LPARs and similar stuff. As a starting point I want to use the NIM server.
I created the dsh snippets already and they do what I want if I call them directly at the prompt from the NIM server.
Consider:
dsh -N all \
ls -d /*/oracle/product/* 2> /dev/null | \
sed -e "s/\.<censored>:/ $(date +"%Y%m%d%H%M")/" 1> /stage/shared/betr_meta/out.new/oracle_homes.out
# gives the desired reult:
root@p9kau-p1nim:~ -> head -5 /stage/shared/betr_meta/out.new/oracle_homes.out
p9kau-p1h 202202181420 /zebparch/oracle/product/19_3_0
p9kau-t1a 202202181420 /orazebe/oracle/product/19_3_0
p9kau-t1a 202202181420 /orazebt/oracle/product/11.2
p9kau-t1a 202202181420 /orazebt/oracle/product/11.2.0.4
p9kau-t1a 202202181420 /orazebt/oracle/product/19_3_0
But If i put this `dsh`block in a shell-script this ends directly after the return of the dsh call:
The follwing script `oracle_homes.dsh.sh`
#!/bin/bash
set -euo pipefail
set -x
IFS=$' \n\t'
# Liste aller ORACLE_HOMEs
# Spalten
# * Hostname
# * Zeitpunkt
# * ORACLE_HOME - Pfad
echo $$
dsh -N all \
ls -d /*/oracle/product/* 2> /dev/null | \
sed -e "s/\<censored>/ $(date +"%Y%m%d%H%M")/" 1> /stage/shared/betr_meta/out.new/oracle_homes.out
echo Hello
Ends without error but does
not print 'Hello' .
Why ?
root@p9kau-p1nim:~ -> /stage/shared/betr_meta/oracle_homes.dsh.sh
+ IFS='
'
+ echo 17760586
17760586
++ date +%Y%m%d%H%M
+ dsh -N all ls -d '/*/oracle/product/*'
+ sed -e 's/<censored> 202202181427/'
I planned to integrate several dsh calls in one shell script but I have no idea how to do it.
Can anybody help ?
Thanks for your time
Norbert
------------------------------
Norbert Klamann
------------------------------