monica
November 2, 2006, 7:30pm
1
At the moment I do not know anything UNIX script :rolleyes:
but i need to make script that prints the content of the archives
(of text) that are deposited in a directory and Later erases these
archives, leaving the directory emptiness
It would be like repository for print
please help me
thanks
monica
you may use cat command to print contents of text files, once they are extracted from the archived file.
use rm command to delete files once you are done with printing
MYDIR=/home/sri
cd $MYDIR
ls -1 $MYDIR | lp # list all the file in sri directory and print those file by lp command
use this simple code ..still you want more help
pls give full details with simple example....
monica
November 3, 2006, 8:06am
4
Thanks Yogesh and thanks srikanthus too.
i think that will use the option "ls -1 $MYDIR | lp "
another question....
If i want to automatice How i do?
May be very interesante every 5 minutes print the contens of the directoy , (and this script must be resident) How i do ?
Thanks again
monica
PD: excuseme but my english is not too good
save this script, chmod 755, and put a line in the cron file to execute the script at desired time; call it directly like : /home/user/script. ot the respective location.
monica
November 3, 2006, 7:01pm
6
thanks sysgate ....!
well
i`m working in the idea but i dont have de unix here(i am at home it is for the work)
I need opinions about this
Work? :rolleyes:
MYDIR=/usr/xgf/mislib/ftp2prn
cd $MYDIR
ls -l > /usr/tmpA
cantarch = `wc -l /usr/tmpA`
if ($cantarch > 0) then
ls -1 $MYDIR | lp
ls -1 $MYDIR | rm
rm tmpA
else
rm /usr/tmpA
endif
Regards
Monica
I understood that you want to execute this script automatically.
for this you will have to enter in crontab file...
pls dig up this link , you must get the useful info ...
Try this cron and crontab
thanks
srikanth
monica
November 4, 2006, 8:21am
8
srikanth, you understood fine !
i am thinking about this and if i want to execute this script automatically every 5 minutes need put a crontab like this
*/5 * * * * /usr/bin/bash/dfpe5m.sh
it is fine?
need your opinion, thanks !!!
regards
monica
aigles
November 4, 2006, 8:42am
9
The syntax */5 isn't supported by all Unix flavors.
An alternative is to specify explicitly the values:
0,5,10,15,10,25,30,35,40,45,50,55 * * * * /usr/bin/bash/dfpe5m.sh
Jean-Pierre.
monica
November 4, 2006, 9:02am
10
thanks aigles!!!
is very important your opinion for me, because i don`t know anything about UNIX script .... i am a beginer and the boos dont�t giveme opinions
thanks
regards
monica