ultimatly the $media_list var should just be a list of number:number:number etc. I pass it this through a file right now that I have to manually zero out each time I run the script. I want to create a file or blat the number out of the array directly to the command. Can someone give me a hint on how to do either? Thanks.$ejected_tapes=0 ; my @tapes_to_eject=@_ ; # Going to add the file checks and date stuff in perl – ongoing # We are going to have to generate a unique file # Todo: make better use of array itteration $stamp=`/bin/date +%Y%m%d%H%M%S`; `/bin/touch /u01/scripts/logs/$stamp.tapes`; $file="/u01/scripts/logs/$stamp.tapes"; # Now lets open a unique file and not worry about deleting each time open (MYFILE, '>>$file'); print MYFILE "$\@_[0]:$\@_[1]:$\@_[2]:$\@_[3]:$\@_[4]:$\@_[5]:$\@_[6]: +$\@_[7]:$\@_[8]:$\@_[9]:$\@_[10]:$\@_[11]:$\@_[12]:$\@_[13]:$\@_[14]" +; close (MYFILE); $media_list=`/bin/cat /u01/scripts/logs/$file`; If ( $ejected_tapes == $maxslots ) { print "The export door in robot $robot_num only holds $maxslot +s tape(s), \n"; print "and BLAM has now ejected that many tapes. Please go and + empty the\n"; print "import/export doors and press <RETURN> when you're fini +shed"; $ready=<STDIN>; $ejected_tapes=0; } `/usr/openv/volmgr/bin/vmchange -res -multi_eject -w -verbose +-rn $robot_num -rt tld -rh $robot_host -ml $media_list` ; }
In reply to Help With Perl and Files by mrbbq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |