Tip: template for a safe and portable script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tip: template for a safe and portable script
Prev   Next
# 3  
Old 03-19-2019
Regarding the du and df:
I have seen an old Unix man page that tells to look up the block size in the /usr/include/**.h files.
Not very user-friendly. In SysV it has always been 512 bytes. I think they wanted to have a small buffer in the kernel driver (and physical sector size was much below 512 bytes at that time).
du -k and df -k seem to be widespread in Unix and are allowed(ignored) in Linux.
But in Solaris, df -k not only changes the values to kilobyte, it also changes the (really bad) SysV-style output to the BSD-style (that BSD Unix and Linux always use).
Being Posix-compliant, e.g. by using my template, df -kP might be quite portable (in Linux even avoids a brain-damaged "split long lines in two even if destination is not a terminal").
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question
MKCOVER(8)						      System Manager's Manual							MKCOVER(8)

NAME
mkcover - HylaFAX continuation cover page generation command SYNOPSIS
/var/spool/hylafax/bin/mkcover qfile template result DESCRIPTION
bin/mkcover is the command invoked by the facsimile server when a continuation cover page is required for an outbound job that is about to be retried. It generates a single POSTSCRIPT(R) page that is imaged according to the remote capabilities and transmitted as the cover page. The arguments are: qfile the job description file for the outbound job. template the cover page template file, as used by the faxcover(1) program. result the filename where the resultant POSTSCRIPT document should be written. The default mkcover command is a shell script that uses awk(1) to parse the job description file and generate the cover page document. The template file may be optionally compressed with compress(1), pack(1), or gzip(1); the filename suffix is used to decide whether or not the template file contains compressed data. SEE ALSO
faxq(8), hylafax-config(5), sendq(5) June 20, 1994 MKCOVER(8)