lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev LYNX, TRN: neat use for "shebang" stuff (from Kermit7)


From: David Combs
Subject: lynx-dev LYNX, TRN: neat use for "shebang" stuff (from Kermit7)
Date: Tue, 5 Oct 1999 07:37:38 -0700 (PDT)

Just saw this post on the kermit newsgroup -- seemed applicable
to lynx, trn, etc:


Article: 10666 of comp.protocols.kermit.misc
From: address@hidden (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: carrier-watch. How do I set it off???
Date: 4 Oct 1999 15:57:55 GMT
Organization: Columbia University
Lines: 49

In article <address@hidden>,
Yoner, Clinton (EXCHANGE:WDLN2:2Y64) <address@hidden> wrote:
: I am running a script which starts kermit as follows:
: 
:   kermit -C "log session $2, c, exit" -l /dev/$1 -b 9600
: 
: With kermt 7.0 beta (i am running Linux 6.0) it barks about the
: "carrier" and I have to set it "OFF"
: Yes I am just talking to a device ( not a modem) via TTYS1.
: So am looking for a command-line option to add to the above kermit call
: 
We don't have command-line options that correspond to every command and
setting.  That's what the -C "commandlist" escape clause is for:

  kermit -C "set car of, set lin /dev/$1, set sp 9600, l s $2, c, ex"

(Minimal abbreviations are used to keep the line length down.)  The trick is
to put everything in the command list, because when you mix a command list
with command-line options, the order of execution might not be what you
expect (see "Using C-Kermit", pp.461-462, for details).

C-Kermit 7.0 supports a new execution method, called the "kerbang" script,
in which Kermit scripts can be run as if they were shell scripts (or Perl
scripts, etc), with arguments passed on the command line.  Here is a sample,
which illustrates how to add robustness (arguments are checked for, errors
are handled, etc):

  #!/usr/local/bin/wermit +
  if not def \%1 exit 1 \%0: Device name required
  if not def \%2 exit 1 \%0: Logfile name required
  log session \%2
  if fail exit 1 Can't open logfile \%2
  set modem type none
  set carrier-watch off
  set line /dev/\%1
  if fail exit 1 Can't open /dev/\%1
  set speed 9600
  connect
  exit

Save it as "makeaconnection" and then you can:

  $ makeaconnection ttyS0 foo.log

For details, plus lots of examples of kerbang scripts, see:

  http://www.columbia.edu/kermit/ckscripts.html

- Frank



reply via email to

[Prev in Thread] Current Thread [Next in Thread]