FG
💻 Software

Aliases in subshell / child process

Fresh5 days ago
Mar 15, 202625764 views
Confidence Score0%
0%

Problem

I set up aliases in /etc/profile.d/alias.sh for each login shell. But if I run script.sh, I can't use that alias. How can I set alias even for subshells or child processes ? /etc/profile.d/alias.sh

Error Output

alias rmvr='rm -rv';
alias cprv='cp -rv';
alias mvrv='mv -rv';

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Aliases in subshell / child process

Low Risk

If you want them to be inherited to sub-shells, use functions instead. Those can be exported to the environment ( ), and sub-shells will then have those functions defined. So, for one of your examples: If you have a bunch of them, then set for expor…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment