Next: , Previous: , Up: Gcal Utilities   [Contents][Index]


B.2 Invoking txt2gcal

The Txt2gcal program creates a verbatim Gcal resource file from a text file. Its arguments are as follows:

txt2gcal [--help | --version] | [text-file|-] [date-part]

If no text-file argument is given or/but a single ‘-’ character, the program reads and processes all input received from the standard input channel. If no date-part argument is given, Txt2gcal creates a ‘0’ for the date part. All results are always shown on the standard output channel. An exit status of 0 means all processing is successfully done, any other value means an error has occurred.

The program accepts the following options:

--help

Print a usage message listing all available options, then exit successfully.

--version

Print the version number, then exit successfully.

Here comes an example how to use Txt2gcal. Let us suppose there is a text file by the name of tdemo-1.txt with the following contents:

$ cat tdemo-1.txt
-|         Hi friends,
-|
-| I'm the demo text containing funny characters and character
-| sequences like ~~ \~ % %% $a $1 %%%\
-| %\ %s %%foo %bar \%Baz \\~ \~\ and so on...
-| I'm be anxious how I'll be transformed by `txt2gcal'.
-|

and Txt2gcal processes this file, redirecting the output to tdemo-1.rc:

$ txt2gcal tdemo-1.txt 0*d1#999 > tdemo-1.rc
$ cat tdemo-1.rc
-| 0*d1#999 \        Hi friends,~\
-| ~\
-| I'm the demo text containing funny characters and character~\
-| sequences like \~\~ \\~ % %% \$a $1 %%%\ ~\
-| %\ \%s %\%foo \%bar \\%Baz \\\~ \\~\ and so on...~\
-| I'm be anxious how I'll be transformed by `txt2gcal'.~\

then Txt2gcal has now created a new Gcal resource file tdemo-1.rc from the text file tdemo-1.txt. Let us finally see, how Gcal will interpret this new resource file:

$ gcal %19960101 -H no -Ax -f ./tdemo-1.rc
-|
-| Mon, Jan   1st 1996:
-|         Hi friends,
-|
-| I'm the demo text containing funny characters and character
-| sequences like ~~ \~ % %% $a $1 %%%\
-| %\ %s %%foo %bar \%Baz \\~ \~\ and so on...
-| I'm be anxious how I'll be transformed by `txt2gcal'.
-|

Next: , Previous: , Up: Gcal Utilities   [Contents][Index]