Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count increments by one

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
GB
I run a script to eject tapes (found within a list like so)
c00234
c00456
but what I need to do is ensure that the amount of tapes ejected is the same as listed within the tape list.

At the moment I perform this action:

for x in `cat tapelist`
do
dsmadmc -id=me pa=password move dr $x remove=yes
done
fi

Any ideas ?

 
The script isnt the solution.
I need a count to count the number of tapes ejected.

Meaning the amount of tapes ejected should equal the amount of tapes listed in tape list.
At the moment there isnt a count.
 
to initialize a count:
N=0

to increase a count:
N=`expr $N + 1`

You probably want to check if your command was successful before increasing;
I don't know dsmadmc command and its return codes,
but you may try this:
dsmadmc ... && N=`expr $N + 1`
 
Yes definitely need to check that the command was successful! Will use the count you recommend.....

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top