Hi
Hope I'm in the right forum here as its a combination of TSM and scripting on AIX.
What I'm looking at doing is using a TSM macro file containing the list of commands I want to run. The command takes the format:
dsmadmc -id=(user id) -pa=(password) -itemcommit macro /tmp/tsm_macro_file.txt
The macro file itself would contain lines such as:
q event * * begindate=today-1
q vol * access=readwrite,readonly status=full,filling stgpool=offsite
q vol * access=readwrite,readonly status=full,filling stgpool=offsite_oracle
etc etc
The problem I'm having is getting a script to use these commands in turn using the read command.
If I set it up as follows:
pg /tmp/tsm_macro_file.txt | while read COMMAND; do
echo ${COMMAND}
done
It treats the * symbol of the command as a wildcard and lists every file in its working directory, which I obviously don't want.
If I have the macro file set up using backslash as follows:
q event \* \* begindate=today-1
Then the read command reads the line exactly as its read above without the wildcard interpretation, but it also passes it to TSM that way which equally doesn't work.
Anyone any suggestions please?
Hope I'm in the right forum here as its a combination of TSM and scripting on AIX.
What I'm looking at doing is using a TSM macro file containing the list of commands I want to run. The command takes the format:
dsmadmc -id=(user id) -pa=(password) -itemcommit macro /tmp/tsm_macro_file.txt
The macro file itself would contain lines such as:
q event * * begindate=today-1
q vol * access=readwrite,readonly status=full,filling stgpool=offsite
q vol * access=readwrite,readonly status=full,filling stgpool=offsite_oracle
etc etc
The problem I'm having is getting a script to use these commands in turn using the read command.
If I set it up as follows:
pg /tmp/tsm_macro_file.txt | while read COMMAND; do
echo ${COMMAND}
done
It treats the * symbol of the command as a wildcard and lists every file in its working directory, which I obviously don't want.
If I have the macro file set up using backslash as follows:
q event \* \* begindate=today-1
Then the read command reads the line exactly as its read above without the wildcard interpretation, but it also passes it to TSM that way which equally doesn't work.
Anyone any suggestions please?