FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-28-2011, 03:03 PM
Miles Fidelman
 
Default broken shell script with dash

Michael P. Soulier wrote:

Hi,

Is this syntax not supported by posix?

cat /etc/aliases.{1,2}> /etc/aliases

Since I upgraded to squeeze and picked up dash this part of my script broke.



of course you could just run your script under bash

--
In theory, there is no difference between theory and practice.
In<fnord> practice, there is. .... Yogi Berra



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D90A330.1070601@meetinghouse.net">http://lists.debian.org/4D90A330.1070601@meetinghouse.net
 
Old 03-28-2011, 03:23 PM
"Boyd Stephen Smith Jr."
 
Default broken shell script with dash

On 2011-03-28 09:10:07 Michael P. Soulier wrote:
>Is this syntax not supported by posix?
>
>cat /etc/aliases.{1,2} > /etc/aliases

No, brace expansion is not required by any (published[1]) edition of POSIX or
the Single UNIX Specification.

For this case though, you can generally use (cat /etc/aliases.[12] >
/etc/aliases).

[1] I'm not sure about the work-in-progress SUSv4 or a work-in-progress POSIX,
if one exists.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
 
Old 03-28-2011, 04:04 PM
Thilo Six
 
Default broken shell script with dash

Michael P. Soulier wrote the following on 28.03.2011 16:10

> cat /etc/aliases.{1,2} > /etc/aliases

$ ./checkbashisms fooo.sh
possible bashism in fooo.sh line 2 (brace expansion):
cat /etc/aliases.{1,2} > /etc/aliases

checkbashisms is in devscripts but i would not advocate to install the hole
beast. Just download the .deb and extract it.

--
bye Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: imqbi1$mah$1@dough.gmane.org">http://lists.debian.org/imqbi1$mah$1@dough.gmane.org
 
Old 03-28-2011, 05:05 PM
Andrew McGlashan
 
Default broken shell script with dash

Hi,

Thilo Six wrote:

Michael P. Soulier wrote the following on 28.03.2011 16:10


cat /etc/aliases.{1,2} > /etc/aliases


$ ./checkbashisms fooo.sh
possible bashism in fooo.sh line 2 (brace expansion):
cat /etc/aliases.{1,2} > /etc/aliases

checkbashisms is in devscripts but i would not advocate to install the hole
beast. Just download the .deb and extract it.


Why, we are not running on zx80, trs-80, apple ][, vic20 or anything
like that these days; disk is cheap and a few extra MBs isn't going to
hurt anything today.


The WHOLE package is worth how many bytes? The installed size for the
squeeze version is under 2MB, unless you need the ia64 version which is
closer to 4MB [1]. What's the big deal? I don't think it's worth the
effort of extracting it from the .deb file. Heck, I'm not even so sure
this email is worth the effort ;-)


[1] http://packages.debian.org/squeeze/devscripts

--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D90BFD1.1000209@affinityvision.com.au">http://lists.debian.org/4D90BFD1.1000209@affinityvision.com.au
 
Old 03-28-2011, 06:41 PM
Thilo Six
 
Default broken shell script with dash

Andrew McGlashan wrote the following on 28.03.2011 19:05

> Hi,
>
> Thilo Six wrote:
>> Michael P. Soulier wrote the following on 28.03.2011 16:10
>>
>>> cat /etc/aliases.{1,2} > /etc/aliases
>>
>> $ ./checkbashisms fooo.sh
>> possible bashism in fooo.sh line 2 (brace expansion):
>> cat /etc/aliases.{1,2} > /etc/aliases
>>
>> checkbashisms is in devscripts but i would not advocate to install the hole
>> beast. Just download the .deb and extract it.
>
> Why, we are not running on zx80, trs-80, apple ][, vic20 or anything
> like that these days; disk is cheap and a few extra MBs isn't going to
> hurt anything today.
>
> The WHOLE package is worth how many bytes? The installed size for the
> squeeze version is under 2MB, unless you need the ia64 version which is
> closer to 4MB [1]. What's the big deal? I don't think it's worth the
> effort of extracting it from the .deb file. Heck, I'm not even so sure
> this email is worth the effort ;-)
>
> [1] http://packages.debian.org/squeeze/devscripts

# aptitude install devscripts
The following NEW packages will be installed:
autopoint{a} [0.18.1.1-3] (for devscripts)
build-essential{a} [11.5] (for devscripts)
debhelper{a} [8.0.0] (for devscripts)
debian-keyring{a} [2010.12.29] (for devscripts)
devscripts [2.10.69+squeeze1] dpkg-dev{a} [1.15.8.10] (for devscripts)
dput{a} [0.9.6.1] (for devscripts) equivs{a} [2.0.8] (for devscripts)
fakeroot{a} [1.14.4-1] (for devscripts)
g++{a} [4:4.4.5-1] (for devscripts)
g++-4.4{a} [4.4.5-8] (for devscripts)
gettext{a} [0.18.1.1-3] (for devscripts)
git{a} [1:1.7.2.5-1] (for etckeeper)
html2text{a} [1.3.2a-15] (for devscripts)
intltool-debian{a} [0.35.0+20060710.1] (for devscripts)
libalgorithm-diff-perl{a} [1.19.02-2] (for devscripts)
libalgorithm-diff-xs-perl{a} [0.04-1] (for devscripts)
libalgorithm-merge-perl{a} [0.08-2] (for devscripts)
libauthen-sasl-perl{a} [2.1500-1] (for devscripts)
libclass-inspector-perl{a} [1.24-1] (for devscripts)
libcommon-sense-perl{a} [3.3-1] (for devscripts)
libconvert-binhex-perl{a} [1.119+pristine-3] (for devscripts)
libdevel-symdump-perl{a} [2.08-3] (for devscripts)
liberror-perl{a} [0.17-1] (for etckeeper)
libfcgi-perl{a} [0.71-1] (for devscripts)
libio-pty-perl{a} [1:1.08-1] (for devscripts)
libio-stringy-perl{a} [2.110-4] (for devscripts)
libipc-run-perl{a} [0.89-1] (for devscripts)
libjson-perl{a} [2.21-1] (for devscripts)
libjson-xs-perl{a} [2.290-1] (for devscripts)
libmail-sendmail-perl{a} [0.79.16-1] (for devscripts)
libmime-tools-perl{a} [5.428-1] (for devscripts)
libossp-uuid-perl{a} [1.6.2-1] (for devscripts)
libparse-debcontrol-perl{a} [2.005-2] (for devscripts)
libpod-coverage-perl{a} [0.21-1] (for devscripts)
libsoap-lite-perl{a} [0.712-2] (for devscripts)
libstdc++6-4.4-dev{a} [4.4.5-8] (for devscripts)
libsys-hostname-long-perl{a} [1.4-2] (for devscripts)
libtask-weaken-perl{a} [1.03-1] (for devscripts)
libterm-size-perl{a} [0.2-4+b1] (for devscripts)
libtest-pod-perl{a} [1.42-1] (for devscripts)
libtie-ixhash-perl{a} [1.21-2] (for devscripts)
libunistring0{a} [0.9.3-3] (for devscripts)
libyaml-syck-perl{a} [1.12-1] (for devscripts)
lintian{a} [2.4.3] (for devscripts) make{a} [3.81-8] (for devscripts)
po-debconf{a} [1.0.16+nmu1] (for devscripts)
strace{a} [4.5.20-2] (for devscripts)
0 packages upgraded, 48 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/51,6 MB of archives. After unpacking 94,4 MB will be used.
Do you want to continue? [Y/n/?]


--
bye Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: imqkpf$j06$1@dough.gmane.org">http://lists.debian.org/imqkpf$j06$1@dough.gmane.org
 
Old 03-28-2011, 07:48 PM
Ron Johnson
 
Default broken shell script with dash

On 03/28/2011 01:41 PM, Thilo Six wrote:

Andrew McGlashan wrote the following on 28.03.2011 19:05

[snip]

Why, we are not running on zx80, trs-80, apple ][, vic20 or anything
like that these days; disk is cheap and a few extra MBs isn't going to
hurt anything today.

The WHOLE package is worth how many bytes? The installed size for the
squeeze version is under 2MB, unless you need the ia64 version which is
closer to 4MB [1]. What's the big deal? I don't think it's worth the
effort of extracting it from the .deb file. Heck, I'm not even so sure
this email is worth the effort ;-)

[1] http://packages.debian.org/squeeze/devscripts


# aptitude install devscripts
The following NEW packages will be installed:
autopoint{a} [0.18.1.1-3] (for devscripts)

[snip]

libyaml-syck-perl{a} [1.12-1] (for devscripts)
lintian{a} [2.4.3] (for devscripts) make{a} [3.81-8] (for devscripts)
po-debconf{a} [1.0.16+nmu1] (for devscripts)
strace{a} [4.5.20-2] (for devscripts)
0 packages upgraded, 48 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/51,6 MB of archives. After unpacking 94,4 MB will be used.
Do you want to continue? [Y/n/?]



Since that's 8/10 of 1% of 1% of a 640GB drive, I'm not impressed with
your argument.


--
"Neither the wisest constitution nor the wisest laws will secure
the liberty and happiness of a people whose manners are universally
corrupt."
Samuel Adams, essay in The Public Advertiser, 1749


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D90E5F8.2010602@cox.net">http://lists.debian.org/4D90E5F8.2010602@cox.net
 
Old 03-29-2011, 03:29 PM
Thilo Six
 
Default broken shell script with dash

Ron Johnson wrote the following on 28.03.2011 21:48

-- <snip> --

> Since that's 8/10 of 1% of 1% of a 640GB drive, I'm not impressed with
> your argument.

Then ignore it. Thanks.

--
bye Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: imsts6$s9a$1@dough.gmane.org">http://lists.debian.org/imsts6$s9a$1@dough.gmane.org
 
Old 04-06-2011, 12:33 PM
"Michael P. Soulier"
 
Default broken shell script with dash

On 28/03/11 Miles Fidelman said:

> of course you could just run your script under bash

And I am, but why is dash claiming to be a posix shell by being /bin/sh?

Mike
 
Old 04-06-2011, 12:34 PM
"Michael P. Soulier"
 
Default broken shell script with dash

On 28/03/11 Boyd Stephen Smith Jr. said:

> No, brace expansion is not required by any (published[1]) edition of POSIX or
> the Single UNIX Specification.
>
> For this case though, you can generally use (cat /etc/aliases.[12] >
> /etc/aliases).
>
> [1] I'm not sure about the work-in-progress SUSv4 or a work-in-progress POSIX,
> if one exists.

Hmm, ok. I'll work around it. I prefer my scripts to be portable to all unixes
if possible.

Mike
--
Michael P. Soulier <msoulier@digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein
 

Thread Tools




All times are GMT. The time now is 06:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org