#17 csh is assumed to exist, and that's not always so

closed-fixed
None
6
2006-01-02
2001-02-11
Jens Luedicke
No

I added an extra -D__LINUX__ in the Linux Makefile
to use /bin/sh instead of /bin/csh, and changed in file.c
tmpnam to mkstemp, so my linker wouldn't complain anymore
and I added little "make install" and "make uninstall" options.

Discussion

  • Jens Luedicke
    Jens Luedicke
    2001-02-11

    None

     
    Attachments
  • Scott Tringali
    Scott Tringali
    2001-03-25

    Logged In: YES
    user_id=11321

    Which Linux distro has the problem? We try to keep the
    makefiles very simple so that they need no modifications.

    I don't think we'll use the 'make install/uninstall' just
    yet. NEdit has a one-binary zero-install policy that we're
    keeping.

    But if there are compile and linker problems on your distro,
    please let us know exactly what they are.

     
  • Scott Tringali
    Scott Tringali
    2001-03-25

    • assigned_to: nobody --> edel
     
  • Jens Luedicke
    Jens Luedicke
    2001-03-26

    Logged In: YES
    user_id=38210

    my linker complains about tmpnam in file.c.
    I changed it to mkstemp. Works well on my
    Debian unstable box.
    /bin/sh should be the standard shell for Linux OS's,
    because I don't have /bin/csh installed and therefore
    shell commands from NEdit won't work.

     
  • Scott Tringali
    Scott Tringali
    2001-03-27

    Logged In: YES
    user_id=11321

    Okay, the warning about tmpnam I can live with. However, if
    we're relying on /bin/csh being around, and it's not, we
    need to fix it.

    Is there any way NEdit can fall back on /bin/sh gracefully?
    Or perphaps not encode csh into the executable, letting the
    system pick? One would think we should use whatever shell
    the user has as a default.

    This patch is awful large, so I really can't review your
    changes. Did you really change a few thousand lines of
    code?

     
  • Jens Luedicke
    Jens Luedicke
    2001-03-27

    Logged In: YES
    user_id=38210

    Ignore the patch. It's somehow messed up.
    (some hidden CVS file has been included....)
    However, to get NEdit working with /bin/sh
    I added the -D__LINUX__ option, because
    there is something similar with __MVS__,
    to use /bin/sh in preferences.c. There is an
    environment variable SHELL on my system that
    points to /bin/bash. getenv that variable and use
    it's value. Otherwise use /bin/sh as the default shell,
    because it is anyway the standard on most *nix systems.

     
  • Alexander Mai
    Alexander Mai
    2001-08-25

    Logged In: YES
    user_id=15180

    Ok, tmpnam() is still inside, but IIRC the
    code is at least able to handle this
    correctly. BTW, why didn't we use tmpfile()?
    (yeah, probably discussed already)

    What about the csh issue? I think I'll
    change things at least for OS/2.

     
  • Thorsten Haude
    Thorsten Haude
    2002-12-07

    Logged In: YES
    user_id=119143

    This patch seems to get a bit stale, last input was over a
    year ago. Can it be closed?

     
  • Thorsten Haude
    Thorsten Haude
    2003-02-19

    Logged In: YES
    user_id=119143

    Can this be closed, please?

     
  • Scott Tringali
    Scott Tringali
    2003-02-19

    Logged In: YES
    user_id=11321

    I think the patch for csh is inappopriate. But we have a
    small bug where we assume csh is installed on the system
    (and some dependencies on that), and I was hoping that we
    could somehow "automatically" fall back to /bin/sh if csh is
    not available. The user should modify the nedit.shell
    X-resource instead of recompiling, though.

    Renamed title and changed to bug.

     
  • Scott Tringali
    Scott Tringali
    2003-02-19

    • summary: misc. changes --> csh is assumed to exist, and that's not always so
    • labels: 300100 -->
    • priority: 5 --> 2
    • assigned_to: edel --> nobody
     
  • Thorsten Haude
    Thorsten Haude
    2003-04-08

    Logged In: YES
    user_id=119143

    Falling back to /bin/sh is not enough, at least one shell
    command must be changed. That shouldn't be too hard though,
    there is already a special version for Linux in preferences.c.

     
  • Thorsten Haude
    Thorsten Haude
    2003-04-29

    • assigned_to: nobody --> yooden
     
  • Thorsten Haude
    Thorsten Haude
    2003-04-29

    Logged In: YES
    user_id=119143

    I think the old default should be changed, even if it means
    that some users would have change their ~/.Xdefaults to keep
    the same behavior.

    I suggest to add a function
    char* GetDefaultShell()
    which would return one of:
    - the user's login shell if there's any POSIX way to find out,
    - ${SHELL},
    - /bin/sh, which is the most common subset.

    About the default shell commands: The 'wc' command seems to
    be the only one that would need to be changed, and awk
    should do:
    wc | awk '{print $1 " words, " $2 " lines, " $3 "
    characters"}'
    Could someone verify this for a csh?

     
  • Thorsten Haude
    Thorsten Haude
    2003-05-06

    Logged In: YES
    user_id=119143

    This Patch changes the default shell to 'sh'.

     
  • Thorsten Haude
    Thorsten Haude
    2003-05-06

    Changes the default shell to 'sh'

     
  • Thorsten Haude
    Thorsten Haude
    2003-05-06

    Changes the default shell to the user's login shell

     
  • Thorsten Haude
    Thorsten Haude
    2003-05-06

    Logged In: YES
    user_id=119143

    This Patch changes the default shell to the user's login shell.

     
  • Thorsten Haude
    Thorsten Haude
    2005-02-06

    • priority: 2 --> 6
     
  • Noah Spurrier
    Noah Spurrier
    2005-05-19

    Logged In: YES
    user_id=59261

    Couldn't the shell be a configurable option at run time?

    In any case, it seems like /bin/sh is the more natural default.
    I don't have csh installed and I get errors. I can't even
    run /bin/sh through Execute (alt-X) because
    it needs csh to launch sh.

     
  • Joerg Fischer
    Joerg Fischer
    2005-05-19

    Logged In: YES
    user_id=918104

    >Couldn't the shell be a configurable option at run time?

    If you could read the online help, you could find it is.
    Add
    nedit.shell: /bin/sh
    to your X resources.

     
  • Thorsten Haude
    Thorsten Haude
    2006-01-02

    • status: open --> closed-fixed