I have a list of servers I am trying to gather some info from, however the script I am using does not seem to return any data (I am executing this from one line as I don't have rights to run shell scripts on our backup server! However to make it clearer I have simply removed the ";" character which I put between lines):
I think your problem is that the newline isn't being created. I tested it here and the \n didn't work which caused /tmp/nsradminsap to be all on one line which gives a blank from nsradmin. I added a '-e' after the echo and it worked.
coganb
736 Posts
3268
0
Posted May 31st, 2012 00:00
Hi David,
I think your problem is that the newline isn't being created. I tested it here and the \n didn't work which caused /tmp/nsradminsap to be all on one line which gives a blank from nsradmin. I added a '-e' after the echo and it worked.
-Bobby
bash-3.00# vi saphosts
"saphosts" 14 lines, 206 characters
while true
do
echo -e "show name;group;scheduled backup;schedule;save set\nprint type:NSR client;name:$1">/tmp/nsradminsap
nsradmin -i /tmp/nsradminsap
echo "----------------"
done
-----
bash-3.00# ./saphosts vm-sol-27-109-12345
name: vm-sol-27-109-12345;
scheduled backup: Enabled;
schedule: Default;
group: trace1;
save set: /etc/fonts;
name: vm-sol-27-109-12345;
scheduled backup: Enabled;
schedule: Default;
group: Default;
save set: /Bobby;
...