Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Braces not expanding in shell script

9 views
Skip to first unread message

co4...@yahoo.com

unread,
Jul 1, 2009, 6:00:05 AM7/1/09
to

We have migrated from hp-ux to aix. Some of the shell scripts are not
working on AIX shell

for example

du -k /dir1/db*/data/*/*{.type1,.type2,.type3} used to expand and
produce du -k for each type of file

this is not happening on AIX, Usage of braces {} looks different in
aix.

Apreciate anyone can help.

TIA

Vladimir Usenko

unread,
Jul 1, 2009, 6:34:51 AM7/1/09
to
The POSIX shell is default shell on the HP-UX.
The Korn shell is default shell on AIX.
But I mean the difference located on the `du' command.
I haven't access to HP-UX now for checking it idea.
Thank you.


--
UV-RIPE

casey b

unread,
Jul 1, 2009, 8:44:03 AM7/1/09
to
On AIX I think you want to change your scripts to use ksh93.
"ksh" on AIX is actually ksh88.

This of course may cause other changes of behaviour in your scripts,
and you should test them.

For your specific example on an AIX 5.3 machine:

# touch type1
# touch type2
# touch type3
# ls {type1,type2,type3}
{type1,type2,type3} not found
# ksh93
# ls {type1,type2,type3}
type1 type2 type3

Hope this helps,
Casey

Sven Mascheck

unread,
Jul 8, 2009, 6:24:12 PM7/8/09
to
Vladimir Usenko wrote:
> co4...@yahoo.com wrote:

>> We have migrated from hp-ux to aix. Some of the shell scripts are not
>> working on AIX shell

>> [ brace expansion ]

> The POSIX shell is default shell on the HP-UX.
> The Korn shell is default shell on AIX.

The POSIX implementation on HP-UX is a (possibly slightly
modified) ksh.

Best next step: find out which shell ran your scripts on HP-UX.
On HP-UX 10 and 11, ksh is a ksh88c and sh is a ksh88f.
AFAIK, neither knows brace expansion.
--
http://www.in-ulm.de/~mascheck/various/shells/

0 new messages