Score:3

alias must be in the Bash sub process

us flag

How alias in Bash can be in the forked sub process Bash as get failed on:

alias al='echo hello '
$ al foobar
hello foobar

$ alias al='echo hello ' ; bash
$ al
bash: al: command not found

How to have it on the latter Bash as exactly functional as is ?

Score:3
jp flag

AFAIK, already defined aliases in a parent-shell can't be exported(made available) to sub-shells/processes but can be made available to sub-shells by sourcing a file in which they are defined e.g. ~/.bashrc ... Which means, in other words, redefining them in the sub-shells.

Functions, on the other hand, can be exported with export -f name ... So, you can use a function instead like so:

$ function al { echo "hello $1"; }; export -f al; bash
$
$ al
hello
$
$ al again
hello again
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.