[Techtalk] metacharacters and other oddities

Akkana Peck akkana at shallowsky.com
Thu Jan 1 01:16:02 EST 2004


David Sumbler writes:
> On Sat, 13 Dec 2003, Carla Schroder wrote:
> > Is there a printed or online reference somewhere that documents Linux
> > metacharacters? Here is one example of what I'm looking for: in
> > programs like Pan and Kmail, there are options for configuring external
> > programs:
> >
> > gvim %f = Kmail external editor -- %f = file
> > mozilla %s = Pan web browser --  %s = URL
> > xterm -e vi %t = Pan external editor --  %t = file
> 
> Carla, I know nobody responded on this list, but did you ever find the
> answer to your query?  If you did, I for one would be very interested
> to know it.

I don't think I saw a public answer.  I don't think there is a
definitive answer, but here's what I can offer: these come originally
from the format of the printf() call in C.  printf's first argument is
a "format string", a string which tells printf how it should print
the rest of its arguments.  For instance, you might say:
	printf("Happy %d New Year, %s!\n", year, name);
which says that year is a decimal integer (such as 2003) and name
is a string (such as "David").  \n is a newline character.

man 3 printf will give you an exhaustive list of the printf format
types.  But that doesn't answer Carla's question, because she's asking
about configuration options for random programs.  These options are
inspired by the printf format strings -- when you see a %s it almost
certainly means "put your string here" -- but they also sometimes
make up their own format specifiers, like %f for file or %m for month.
In that case, you need to refer to the program's own documentation.
Since different programs have different needs, program A may use
a particular letter to mean something different from program B's
use of the same letter.

Hope that helps a little, anyway ...

	...Akkana


More information about the Techtalk mailing list