0

This seems like it should have a super simple answer, but I have search for a while and tried different suggestions to no avail.

As an example, I am trying to create a function that will be available when the following is ran

sh -c "echo 'test \c'"

I have tried adding the following code right after the shebang / first command in both /etc/profile and /etc/bashrc

echo () {
    builtin echo -e "$@"
}

What is frustrating is that it works in normal sh and bash when logged in. However as soon as sh -c is ran, it just forgets that ever existed. I have tried other tests, like making a function called echo2 and it doesn't exist in sh -c

Now here is the very frustrating thing, it HAS to be sh -c because the proprietary enterprise software application runs its commands inside of sh -c, which I cannot control that... So it HAS to be something that works natively with sh -c "something"

0 Answers0