02-10-2004
lp - order of files printed
I have a shell script that is looping through a list of Postscript files to print.
ls -1tr *.PS > print.lst
...
PRINT_LIST=`cat print.lst`
...
for DMFILE in $PRINT_LIST
do
lp -d $PRINTER_NAME -o legal $DMFILE
...
done
The files in print.lst are in the order that they should be printed, however the order in which the files are printed appears to be completely random.
Here is a sample of print.lst, sequenced in the order to print
/prtspool/racprint/debitmemos/MNSF021.M0209137.PS
/prtspool/racprint/debitmemos/MNSF021.M0209138.PS
/prtspool/racprint/debitmemos/MNSF021.M0209139.PS
/prtspool/racprint/debitmemos/MNSF021.M0209140.PS
/prtspool/racprint/debitmemos/MNSF021.M0209141.PS
/prtspool/racprint/debitmemos/MNSF021.M0209142.PS
/prtspool/racprint/debitmemos/MNSF021.M0209143.PS
/prtspool/racprint/debitmemos/MNSF021.M0209144.PS
Here is the output from lpq:
active racuser 619 MNSF021.M0209137.PS 20200778 bytes
1st racuser 627 MNSF021.M0209145.PS 16781507 bytes
2nd racuser 621 MNSF021.M0209139.PS 20925819 bytes
3rd racuser 625 MNSF021.M0209143.PS 17315067 bytes
4th racuser 607 MNSF021.M0209125.PS 20202748 bytes
5th racuser 633 MNSF021.M0209151.PS 16825285 bytes
6th racuser 628 MNSF021.M0209146.PS 17372512 bytes
7th racuser 629 MNSF021.M0209147.PS 17078571 bytes
8th racuser 606 MNSF021.M0209124.PS 20928279 bytes
9th racuser 610 MNSF021.M0209128.PS 20928424 bytes
Why are the files printing in this seemingly random order? Is there a way that I can force the files to print in the order submitted?
Thanks, MB
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I'm trying to write a ksh script to copy a specified number of files from one directory to another.
The files are named in the convention <switchname>_log.<num> and the numbers are sequential single digit onwards. I figured I could find some parameter for ls which would list the files in... (3 Replies)
Discussion started by: Steve_H
3 Replies
2. UNIX for Dummies Questions & Answers
Im on HP/UX and am trying to find the command like an ll but that will sort showing the most currently modified programs first.
Can anyone help me with that? :cool: (2 Replies)
Discussion started by: Jeannine
2 Replies
3. UNIX for Dummies Questions & Answers
Hello
I have application that part of its command I can get list of files to the stout . with the path .
like :
./blah/blah/foo.c
./blah11/blah11/foo11.c
./blah12/blah12/foo11.h
now I will like to filter this result and for instance see the "*.h" file or the "*.c" file or only the files... (2 Replies)
Discussion started by: umen
2 Replies
4. Shell Programming and Scripting
hi
Is there a way to sort files in the order they were created ,and move them to another directory one by one ,oldest being the first to be moved.
Thanks
Arif (4 Replies)
Discussion started by: mab_arif16
4 Replies
5. Shell Programming and Scripting
Hi,
I have two master files which contain the information for many jobs like this
Job no:1 a b c d
Job no:1 d e g h
Job no:2 t j s h
Job no:2 t j s h
I have written a script to pick up all the information for Job no:1 from file1 and put that to a temporary file and do the same from... (2 Replies)
Discussion started by: ragavhere
2 Replies
6. Shell Programming and Scripting
Hi
I have a requirement like below
I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory
My files looks like this
PGABOLTXML1D_201108121235.xml... (1 Reply)
Discussion started by: saidutta123
1 Replies
7. Shell Programming and Scripting
I want to recursively cat the content of files in a directory e.g.
find /etc -type f -exec cat {} \;
But I want it to print the file name first and then the content. For example let's say /etc/statetab and /etc/colord.conf will be printed first then I want the output to look something like;
... (6 Replies)
Discussion started by: lewk
6 Replies
8. Shell Programming and Scripting
Hi,
I need to list files in ascending order. Filenames are in format inpTDT_1, inpTDT_2, inpTDT_3 and so on.
I want to list them in the ascending order based on the digit after underscore and send the output to a file.
Please help (5 Replies)
Discussion started by: Neelkanth
5 Replies
9. UNIX for Dummies Questions & Answers
Hi there,
How can I loop through files with order.
I tried using ls .html | sort -v
However the filename is with spaces:1233.61.47.0 - 121.61.123.112 nexpose.html
Here is the original code that is working well, but I need to sort through the filename.echo "<center>"
for file in *.html... (2 Replies)
Discussion started by: alvinoo
2 Replies
10. Shell Programming and Scripting
I am looking for help in processing of those options: '-n' or '-p'
I understand what they do and how to use them.
But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.)
I did try it and -n works on 2 files.
Question is:
- is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies
LEARN ABOUT DEBIAN
update-grub
update-grub(8) System Manager's Manual update-grub(8)
NAME
update-grub - program to generate GRUB's menu.lst file
SYNOPSIS
update-grub
DESCRIPTION
update-grub is a program used to generate the menu.lst file used by the grub bootloader. It works by looking in /boot for all files which
start with "vmlinuz-". They will be treated as kernels, and grub menu entries will be created for each. It will also create the initial
menu.lst if none exists, after prompting the user. It will also add initrd lines for ramdisk images found with the same version as kernels
found. e.g. /boot/vmlinuz-2.4.5 and /boot/initrd-2.4.5 will cause a line of "initrd=/boot/initrd-2.4.5 or similar to be added for the ker-
nel entry in the menu.lst.
After update-grub has been run for the first time, the user is required to edit the generated menu.lst. The user must set the two options
update-grub uses. Then re-run the update-grub script to update the menu.lst file using the default's that have been set.
These are the options passed to the linux kernel:
# kopt=root=/dev/hda1 ro
Everything after "kopt=" is passed to the kernel as parameters. See bootparam(7) for more information.
This is the grub device from which grub loads the kernel:
# groot=(hd0,1)
(hd0,1) is a partition in grub notation. See grub(8) for more information.
This option controls if grub should create the alternative boot options in the menu entries
# alternative=true
# alternative=false
This option controls if grub should lock the alternative boot options see grub(8) for more information.
# lockalternative=true
# lockalternative=false
This option controls if grub should lock the old kernels.
# lockold=true
# lockold=false
This options controls what is used for the alternative boot options, multiple altoptions lines are allowed.
# altoptions=(some description) some kernel command line options
# altoptions=(recovery option) single
The description is placed in '()' and the kernel command line options follow that.
# updatedefault=true
# updatedefault=false
This option controls if grub should update the default entry to keep booting the same kernel even if a new one is installed.
The update-grub script can be ran automagically from the /etc/kernel-img.conf file by adding the following lines:
postinst_hook = update-grub
postrm_hook = update-grub
do_bootloader = no
For further information related to /etc/kernel-img.conf, see the manpage kernel-img.conf(5).
SEE ALSO
grub(8), grub-install(8), kernel-img.conf(5) (contained in the kernel-package package), bootparam(7).
The full documentation for grub is maintained as a Texinfo manual in the grub-legacy-doc package. If the info and grub programs are prop-
erly installed at your site, the command
info grub
should give you access to the complete manual.
AUTHOR
This manual page was written by Jason Thomas <jason@debian.org>, for the Debian GNU/Linux system (but may be used by others).
Jason Thomas June 18, 2001 update-grub(8)