linux - variable does not store value while running script from root (unix) -


output variable not store value of "pbrun tsm_support.ksh -c $i" command while running script though root.

 #!/bin/bash set -x  in `cat /home/unixlist.txt`  output=$(pbrun tsm_support.ksh -c $i) echo $output >> /home/file.txt if echo "$output" | grep -i "option01"  ; echo successfull-- $i===$output  

when run script local user id runs file , prints output,

error-- dbsss0006=== starting checkfix script.....dbsss0006:b:sunos:1:1:2:0:z error-- dbsss0005=== starting checkfix script.....dbsss0005:b:sunos:1:1:2:0:z 

but when run script root not take value of output variable. not take value of $output.

  error-- dbsss0006===   error-- dbsss0005=== 

i not have root permissions, can edit crontab file , put entry on there.

the problem environment variables set in crontab versus ones set on command line. not same.

to see have change: put in crontab:

* * * * * set > /tmp/crontab.txt 

save it, wait 2 -3 minuite run, remove crontab change.

next:

set > /tmp/myenv.txt diff /tmp/myenv.txt /tmp/crontab.txt 

will show differences. make changes crontab script has (probably) path variable , ld_library_path variable changes need. not have change every environment variable.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -