Opened 8 years ago

Closed 3 months ago

#7922 closed bug (invalid)

system() call does not launch aliases

Reported by: oco Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/alpha3
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Aliases defined using the alias command can not be run via a system() call.

In the open office build system (OOo4Kids), a shell script define some aliases. If i understand things correctly, those commands are intended to be launch with a perl script (build.pl) that use system(). It does not work under Haiku.

I can workaround the problem with symlinks.

I am not absolutely sure that Haiku should support this. Documents i have found (only a google search) don't describe how system() should work in this case. I don't have a linux box right now to confirm the behavior under Linux. I will do the test next week.

The problem could be reproduced using this c program :

#include <unistd.h>

int main() {

system("ll"); return 0;

}

ll is an alias for "ls -lA" defined by default under Haiku.

This program shows an error :

/bin/sh: ll: command not found

Change History (4)

comment:1 Changed 8 years ago by pulkomandy

There's a difference between ll and custom build-time aliases.

ll is defined in some system-wide sh file (something like /etc/profile, not sure where it is on Haiku). It relies on sh importing this file whenever it loads (as system loads it)

User-defined aliases, on the other hand, relies on sh inheriting aliases from the parent shell ? or how are they defined and run ? I don't think this makes sense, as user customizations to their system shell may break the openoffice build...

comment:2 Changed 8 years ago by oco

My simple test program has the same behavior on my Ubuntu 11.04 as Haiku. There is probably something i have overlook in the OOo4Kids build system. I will ask them how alias commands are supposed to be launched.

comment:3 Changed 4 years ago by luroh

Milestone: R1Unscheduled

Move POSIX compatibility related tickets out of R1 milestone (FutureHaiku/Features).

comment:4 Changed 3 months ago by korli

Resolution: invalid
Status: newclosed

same behavior on ubuntu.

Note: See TracTickets for help on using tickets.