EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: error in caput ("caputting negative numbers")
From: "Brian McAllister" <[email protected]>
To: [email protected]
Cc: Epics Tech-Talk <[email protected]>
Date: Tue, 28 May 2002 00:19:30 -0400
>>> On 5/27/2002 at 16:29:19 EDT, Vitaliy Ziskin wrote:

  > I try do the following :

  > caput channelName.VAL -1

  > and get the following:

  > caput: invalid option -- 1
  > Old : channelName.VAL           0.00

  > What's going on?

You're on GNU/Linux.

caput uses getopt() to parse the command line.  GNU getopt() has different
default behavior from other implementations.

>From the man page:

       By  default,  getopt() permutes the contents of argv as it
       scans, so that eventually all the non-options are  at  the
       end.

Which means that a negative argument will be parsed as a command option,
which caput does not expect.

       If the first character of optstring is `+' or the
       environment variable POSIXLY_CORRECT is set, then option
       processing stops as soon as a non-option argument is
       encountered.

The work-around is to put

    setenv POSIXLY_CORRECT

in your shell startup.

----
Brian McAllister                    Controls Programmer/Beam Physicist
[email protected]                        MIT-Bates Linear Accelerator
(617) 253-9537                                           Middleton, MA


Replies:
Re: error in caput ("caputting negative numbers") Bill Cruise
References:
error in caput ("caputting negative numbers") Vitaliy Ziskin

Navigate by Date:
Prev: Device Support for RAMdisk Jane Richards
Next: EPICS Base 3.13.6 Caveat Ralph . Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: error in caput ("caputting negative numbers") Vitaliy Ziskin
Next: Re: error in caput ("caputting negative numbers") Bill Cruise
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·