POV-Ray : Newsgroups : povray.unix : How to fix "read: 1141: Illegal option -n" in Ubuntu Server Time
22 Dec 2024 04:26:28 EST (-0500)
  How to fix "read: 1141: Illegal option -n" in Ubuntu (Message 1 to 3 of 3)  
From: Josh Kupershmidt
Subject: How to fix "read: 1141: Illegal option -n" in Ubuntu
Date: 14 Jan 2009 18:55:01
Message: <web.496e790f156c502e2adf27b40@news.povray.org>
Sorry if this has been posted before, I didn't see this topic anywhere. I wanted
to share my resolution of an Ubuntu-specific (or possibly any distro that's
symlinked /bin/sh -> /bin/dash) install issue in case anyone else finds it
helpful.

On an Ubuntu 8.10 machine, I attempted to run the install script in the parent
directory of the linux binary install tarballs, for both the most recent 3.6
release and the 3.7 beta 29 release. I ran the scripts as an unprivileged user,
intending to install povray locally. What I saw when I ran the 3.6 ./install
was:

  Type 'R'  to login as root and install in /usr/local
            (recommended method).
  Type 'U'  to make a user level installation at a custom location.
  Type anything else to abort.

read: 1141: Illegal option -n


Installation aborted!

I saw a similar message when I ran the ./install script for version 3.7 beta 29,
with a slightly different line number:

[snip]
read: 1704: Illegal option -n

Installation aborted!

The solution to the above problems for Ubuntu users is to change the top line of
the install file from "#! /bin/sh" to "#! /bin/bash". An explanation by the
Ubuntu team of this problem is available here:

https://wiki.ubuntu.com/DashAsBinSh

Basically, the "-n" flag used in the read command by the install script is
apparently not valid in the /bin/sh shell used by Ubuntu, though /bin/bash
handles this flag fine. To test this behavior on your own system, try the
following command under /bin/sh and /bin/bash :

read -p "Type character here: " -n 1 INPUT && echo " You typed: ${INPUT}"

I'm not sure how to definitively ascertain whether "-n" is a legal flag to
"read" when called from the Bourne Shell (/bin/sh), so I'm not sure whether the
problem I've described is a bug in Ubuntu's implementation of dash (to which
/bin/sh is linked) or whether the install script simply should not be using the
"-n" flag. Kudos to anyone who can answer this question.

Also, there is a typo I noticed in the install script for 3.6 and 3.7 beta 29:
The word "speciafy" is used instead of "specify" in one or two places.

Sorry if this post seems uselessly trivial to people here.. I'm just hoping to
alleviate any frustration by newbie Ubuntu users out there attempting the 3.7
beta or other installs.

Josh Kupershmidt


Post a reply to this message

From: Nicolas Calimet
Subject: Re: How to fix "read: 1141: Illegal option -n" in Ubuntu
Date: 15 Jan 2009 06:46:24
Message: <496f2210@news.povray.org>
> read: 1704: Illegal option -n

	Thanks for the report.  Indeed the install script of the binary packages
uses this bashism as well as the non-POSIX -p option.  This should get fixed
for the next beta(s).

	- NC


Post a reply to this message

From: How Camp
Subject: Re: How to fix "read: 1141: Illegal option -n" in Ubuntu
Date: 15 Jan 2009 07:35:00
Message: <web.496f2cd41cef6402c59235590@news.povray.org>
"Josh Kupershmidt" <schmiddy^at^gmail^dot^com> wrote:
> Sorry if this post seems uselessly trivial to people here.. I'm just hoping to
> alleviate any frustration by newbie Ubuntu users out there attempting the 3.7
> beta or other installs.

As a moderate 'newbie Ubuntu user', I'm rather appreciative of this post.
Thanks, Josh, for taking the effort.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.