[ale] ubuntu users
Björn Gustafsson
bg-ale at bjorng.net
Tue Mar 16 18:32:02 EDT 2010
If you `man test' you will see that == is not in the list of valid
operators. Similarly the bash man page says that " = may be used in
place of == for strict POSIX compliance."
On Tue, Mar 16, 2010 at 5:55 PM, J. D. <jdonline at gmail.com> wrote:
> I have been wondering on this one a bit... Dash is reported in the package
> description as a POSIX-compliant implementation of /bin/sh. So something in
> this picture must not be POSIX-compliant. Is it the shell or the code?
>
> On Tue, Mar 16, 2010 at 5:05 PM, Jim Kinney <jim.kinney at gmail.com> wrote:
>>
>> Description: DASH is a POSIX-compliant implementation of /bin/sh that aims
>> to be as small as
>> : possible. It does this without sacrificing speed where
>> possible. In fact, it is
>> : significantly faster than bash (the GNU Bourne-Again SHell)
>> for most tasks.
>>
>>
>> Might be worth looking into for speed needs.
>>
>> I still can't fathom arrays in bash even though it's supposed to be there
>> now...
>>
>> On Tue, Mar 16, 2010 at 4:52 PM, Geoffrey <lists at serioustechnology.com>
>> wrote:
>>>
>>> Geoffrey wrote:
>>> > Lightner, Jeff wrote:
>>> >> Are you running the same shell on both?
>>> >
>>> > Assuming we are running the same, /bin/sh
>>> >
>>> >> Some distros use tcsh instead of bash by default. They also link sh
>>> >> to
>>> >> it so if you had a shebang of #!/bin/sh it might not be using the
>>> >> shell
>>> >> you think it is.
>>> >
>>> > Interesting, I'll have to check that out, thanks.
>>>
>>> That was it, /bin/sh is linked to dash, not bash. Thanks Jeff.
>>>
>>> >
>>> >> -----Original Message-----
>>> >> From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
>>> >> Geoffrey
>>> >> Sent: Tuesday, March 16, 2010 2:40 PM
>>> >> To: ale
>>> >> Subject: [ale] ubuntu users
>>> >>
>>> >> We have a script that is running just fine on RHEL 5.4. When we run
>>> >> it
>>> >> on ubunutu (with 'set -x') we get the following error:
>>> >>
>>> >> + [ 1 -ne 1 ]
>>> >> + dir=all
>>> >> + echo Option all is valid...
>>> >> Option all is valid...
>>> >> + cd /esc
>>> >> + [ all == all ]
>>> >> [: 1: all: unexpected operator
>>> >> + [ -d all ]
>>> >> + echo Apparently all is not checked out. Sorry
>>> >> Apparently all is not checked out. Sorry
>>> >>
>>> >> Here is the code in question. What is wrong with this?
>>> >>
>>> >> if [ "$dir" == "all" ]
>>> >> then
>>> >> for dir in $DOCS $PERL $WEB $ITPROJECTS $SERVERLOG $DBCONFIG
>>> >> $LOGPRO \
>>> >> $SCRIPTS $THIRDPARTY $ONTHEFLY
>>> >> do
>>> >> if [ -d $dir ]
>>> >> then
>>> >> echo "Updating $dir..."
>>> >> svn update $dir
>>> >> else
>>> >> echo "Apparently $dir is not checked out. Sorry"
>>> >> fi
>>> >> done
>>> >> else
>>> >> .
>>> >> .
--
Björn Gustafsson
More information about the Ale
mailing list