× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: 0.15.5 released
  • From: "Jason M. Felice" <jasonf@xxxxxxxxxxxxxxxx>
  • Date: Thu, 6 Jan 2000 10:35:59 -0500

On Thu, Jan 06, 2000 at 11:14:36PM +1300, Carey Evans wrote:
> "Jason M. Felice" <jasonf@Baldwingroup.COM> writes:
> 
> > - xt5250 script rewritten, is more robust.  Inspired by Gomez Henri's xt5250
> >   patch for his RPMs.  (Duh, I forgot to include your Gnome icon thing...
> >   hmm).  Appending info to your Xdefaults file is no longer necessary.
> >   Also, xt5250 now prompts for the system name if not specified, which
> >   eliminates one point of confusion.
> 
> I've got a few constructive comments on the new xt5250 script.
> 
>  - A faster way to do "$(basename 0)" is "${0##*/}".

Cool.  Learn something new every day.

> 
>  - Using "which" like that is at least Linux, and maybe bash-specific.
>    The POSIX-compatible way to do that seems to be:
> 
>      if command -v dialog >/dev/null 2>&1; then ...

Shell builtins are better.  Strange tho, I've never used a system without 
which (even my old windows boxes had a 'which.exe' that I'd written).
This includes AIX and Solaris.

> 
>    Alternatively, configure could look for dialog with AC_CHECK_PROGS
>    or AC_PATH_PROGS.  Also, Debian has a program called "whiptail"
>    which is more likely to be installed than "dialog", but is
>    compatible.  I think whiptail is originally from Red Hat, actually.
>    configure could see whether either of these exists.

Okay, that's probably the better solution, anyway.  "whiptail" is
command-line compatible?

> 
>  - "2> /tmp/xt5250.$$" could be a security hole.  If that file is
>    actually a symlink to one of the user's files, it will be
>    followed.  Something like this should work:

I had to think about this for a second.  Hmm, interesting.  User 'badguy'
symlinks /tmp/xt5250.45 => /home/goodguy/crontab, then 'goodguy' destroys
his own file when running xt5250.  This is what peer review is good for :)

> 
>      exec 3>&1
>      host=$(dialog ... 2>&1 1>&3)
>      if [ "$?" -gt 0 ]; then exit 1; fi
>      exec 3>&-

1>&3 ?   What's 3?  I thought only DOS had 3 stdxxx (the third being the PRN:
printer).  Hmm, I'll see if that works, if not, I'll see if there is a shell
equivalent of tmpfile().

> 
>    (Is there a better way to write that if?)
> 
>  - An alternative to using xrdb to get the resources is to set
>    XUSERFILESEARCHPATH.  For example:
> 
>      XUSERFILESEARCHPATH=/usr/share/tn5250/%N
>      export XUSERFILESEARCHPATH
> 
>    This then leaves everything in the environment the same after it
>    exits.  The file should be called XTerm rather than xt5250.keys.

Okay.

> 
>  - The script will split any arguments with embedded spaces, even if
>    they're quoted.  (i.e. xt5250 -t "/tmp/log file.txt" won't work.)
>    I could work out a fix for this, but not at this time of night.  :-O

Okay, I was being boneheaded.

> 
> > - More of the installtion is automatic - it should now find the 'tic' 
>command
> >   and install the 5250 terminfo entry (only if 'uname -s' reports "Linux", 
>and
> >   you ran 'make install' as root, tho).
> 
> Wouldn't using AC_CANONICAL_HOST and `host_os' be better than using
> uname -s?

Yes, that would be better, as we are installing this in $bindir.

> 
> Because an xterm and the Linux console aren't the same (which is why
> dialog generated strange graphics) my Debian package installs separate
> terminfos for "linux-5250" and "xterm-5250", which are based on the
> standard ones by including them:
> 
> ------------------------------------------------------------
> 5250|linux-5250|linux console 5250 terminal,
>         kf21=\E[35~, kf22=\E[36~, kf23=\E[37~, kf24=\E[38~,
>         use=linux,
> ------------------------------------------------------------
> xt5250|xterm-5250|xterm 5250 terminal,
>         kf21=\E[35~, kf22=\E[36~, kf23=\E[37~, kf24=\E[38~,
>         kcbt=\E[Z,
>         use=xterm-xfree86,
> ------------------------------------------------------------

I removed smacs, rmacs, and acsc entries from the terminfo entries just
to fix this problem.  I think both your solution and the current solution
would have different maintenance issues.  For example, we load a complete
keymap with loadkeys, so we could possible be using a different set of keys
than the default terminfo for the linux console.  I think your way might be
better for xterm, though.

Geez, and I thought I wrote *good* shell scripts. ;->

-Jay 'Eraserhead' Felice
+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to LINUX5250@midrange.com.
| To subscribe to this list send email to LINUX5250-SUB@midrange.com.
| To unsubscribe from this list send email to LINUX5250-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.