Jump to content

Calling Shell scriptters


Recommended Posts

Posted

Mamlu.. morning nunchi try chesthunna e below code work ayye la cheyyataniki.. kani no luck .. I accomplished my task in more dirty way.. kani tell me wat was wrong in this ..

cat servers_list | while read server

do
  if [ ! -d $server ]; then
  mkdir -p $server
  fi

  ssh $server 
              "for db in `cat /etc/oratab |awk -F\: '{print \"\$1}' | sort | uniq |grep -v ^#`;
                    do
                          ls -ltr /home/oracle/init${db}.ora;
                    done" 2>/tmp/junk > dbs_sm.log 

done


for some reason .. ssh command lo for loop ni ela use cheyyaalo ardham avvatledu naku .. particular server ki velli .. local ga aah internal for loop execute authondi..I'm getting intended output

Posted

^^" ^^" ^^" It worked for me


ssh -n $server  "cat /etc/oratab|awk  -F\: '{print \$1}'|grep -v ^#  | while read db
                    do
                          ls -ltr /home/oracle/dbs/init\${db}.ora
                    done" 2>&1 


~"! ~"! ~"! ~"!

Posted

seppeddam anukune lopala nuvve kanukunnava ... good  _-_ _-_ _-_

Posted

[quote author=Emperor link=topic=162471.msg1945147#msg1945147 date=1299124178]
seppeddam anukune lopala nuvve kanukunnava ... good  _-_ _-_ _-_
[/quote] *7*^ *7*^ expect chesa nuvvee 1st reply isthaav ani

Posted

[quote author=Musugu_Veerudu link=topic=162471.msg1945149#msg1945149 date=1299124221]
*7*^ *7*^ expect chesa nuvvee 1st reply isthaav ani
[/quote] &%" &%" &%"

×
×
  • Create New...