sh and bash aliases

I apologize if this has been asked before but I was curious about something:

if i open up konsole and enter ‘alias’ i see all the standard aliases and any of my custom ones i’ve put in .bashrc

now if enter ‘sh’ in konsole and then enter alias, where do those come from? there are only the predefined aliases from bash.bashrc.

the reason i’m asking is that i’ve got an app that tries to display a webpage by invoking sh and calling netscape. i could recompile the app from source and replace netscape with seamonkey or firefox but i’d rather not change the code with a hack like that. another way would be for it to use the web browser env variable but i’m not sure of how to incorporate that into the code.

from GTKRadiant 1.5 url.cpp source

snprintf (command, sizeof(command), 
            "netscape -remote \"openURL(%s,new-window)\" || netscape \"%s\" &", url, url);

anyway, i thought i’d do it with an alias, but sh isn’t reading from .bashrc. i also tried .profile with both sh and bash alias format.

any help would be appreciated

A simpler solution that doesn’t rely on aliases (which won’t work if the process doesn’t go through a shell to execute a child process). Make a symlink from firefox to netscape:

ln -s /usr/bin/firefox /usr/bin/netscape

or /usr/local/bin/netscape if that’s in everybody’s path, then your change is local.

i already figured i’d just make a symlink in my bin but i was mainly curious about where sh gets it’s aliases.

thanks for the help

From any of the files that are read by bash at startup, e.g. /etc/profile /etc/profile.d/* /etc/bash.bashrc, ~/.bashrc, ~/.bash_profile and files that may be sourced by them. See man bash for details. Also note that when invoked as sh, slightly different rules apply.