Why execution of su - user -c 'command' gives an error "-ksh: line 1: 'command': not found" ?
Issue
- On Red Hat Enterprise Linux 5 (64 bit) system, when I su to a user that has commands set in the env load, I see the following error message.
Eg:
[root@example ~]# su - mac -c "mac -a status"
-ksh: line 1: mac: not found
-
Vendor of "mac" application thinks that it is a Red Hat Enterprise Linux issue with /bin/su or ksh.
-
Why execution of su - user -c 'command' gives an error "-ksh: line 1: 'command': not found" ?
Environment
- Red Hat Enterprise Linux 5
- ksh
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.