baslinux AT lists.ibiblio.org
Subject: Baslinux mailing list
List archive
- From: 3aoo-cvfd AT dea.spamcon.org
- To: BasicLinux List <baslinux AT lists.ibiblio.org>
- Subject: Re: [BL] Simple File Manager
- Date: Sun, 04 Feb 2007 07:23:56 +1300
Lee Forrest wrote:
>
> I just went over the abs guide with a fine-tooth comb.
> There's a lot about formatting (col,column...) but
> nothing like _your_ approach.
>
> Sure appreciate the help and am _very_ glad to know
> how to do that kind of formatting with non-specialized
> tools.
Modifiers for `printf' Formats
------------------------------
A format specification can also include "modifiers" that can control
how much of the item's value is printed and how much space it gets.
The modifiers come between the `%' and the format-control letter.
WIDTH
-----
This is a number specifying the desired minimum width of a field.
Inserting any number between the `%' sign and the format control
character forces the field to be expanded to this width. The
default way to do this is to pad with spaces on the left. For
example,
printf "%5s" "foo"
prints ` foo'
The value of WIDTH is a minimum width, not a maximum. If the item
value requires more than WIDTH characters, it can be as wide as
necessary. Thus,
printf "%5s" "foobar"
prints `foobar'
Preceding the WIDTH with a minus sign causes the output to be
padded with spaces on the right, instead of on the left.
printf "%-5s" "foo"
prints `foo '
.PREC
-----
This is a number that specifies the precision to use when printing.
For the `e', `E', and `f' formats, this specifies the number of
digits you want printed to the right of the decimal point. For
the `g', and `G' formats, it specifies the maximum number of
significant digits. For the `d', `o', `i', `u', `x', and `X'
formats, it specifies the minimum number of digits to print.
For a string, it specifies the maximum number of characters from
the string that should be printed. Thus,
printf "%.4s" "foobar"
prints `foob'
-
Re: [BL] DOS & Shell Scripting Guide (was: long file names) 3C
, (continued)
- Re: [BL] DOS & Shell Scripting Guide (was: long file names) 3C, Karolis Lyvens, 02/02/2007
-
Re: [BL] DOS & Shell Scripting Guide (was: long file names) 3C,
Ron Clarke, 02/02/2007
-
Re: [BL] DOS & Shell Scripting Guide 40,
Lee Forrest, 02/02/2007
-
Message not available
- Re: [BL] DOS & Shell Scripting Guide 41, Lee Forrest, 02/02/2007
- Re: [BL] DOS & Shell Scripting Guide 41, 3aoo-cvfd, 02/02/2007
- [BL] Simple File Manager (was: DOS & Shell Scripting Guide), Lee Forrest, 02/02/2007
- Message not available
- Re: [BL] Simple File Manager 42, Lee Forrest, 02/03/2007
- Re: [BL] Simple File Manager (was: DOS & Shell Scripting Guide), 3aoo-cvfd, 02/03/2007
- Re: [BL] Simple File Manager 44, Lee Forrest, 02/03/2007
- Message not available
- Re: [BL] Simple File Manager 45, Lee Forrest, 02/03/2007
- Re: [BL] Simple File Manager, 3aoo-cvfd, 02/03/2007
- Re: [BL] Simple File Manager 46, Lee Forrest, 02/03/2007
-
Message not available
-
Re: [BL] DOS & Shell Scripting Guide 40,
Lee Forrest, 02/02/2007
Archive powered by MHonArc 2.6.24.