Populate alias DB from a bash script

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
My script startalias.sh:
#!/bin/sh
alias ls='ls -al --color=auto'
When I run this script my alias database does not pick it up.
But if I write it directly in the shell it works.
why?
linux shell-script
add a comment |Â
up vote
0
down vote
favorite
My script startalias.sh:
#!/bin/sh
alias ls='ls -al --color=auto'
When I run this script my alias database does not pick it up.
But if I write it directly in the shell it works.
why?
linux shell-script
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My script startalias.sh:
#!/bin/sh
alias ls='ls -al --color=auto'
When I run this script my alias database does not pick it up.
But if I write it directly in the shell it works.
why?
linux shell-script
My script startalias.sh:
#!/bin/sh
alias ls='ls -al --color=auto'
When I run this script my alias database does not pick it up.
But if I write it directly in the shell it works.
why?
linux shell-script
edited Nov 20 '17 at 21:30
Hauke Laging
53.6k1282130
53.6k1282130
asked Nov 20 '17 at 21:17
vancloud
33
33
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28
add a comment |Â
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
alias is a shell builtin. Executed in a subshell (like in a script) does not affect the main shell.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
alias is a shell builtin. Executed in a subshell (like in a script) does not affect the main shell.
add a comment |Â
up vote
1
down vote
accepted
alias is a shell builtin. Executed in a subshell (like in a script) does not affect the main shell.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
alias is a shell builtin. Executed in a subshell (like in a script) does not affect the main shell.
alias is a shell builtin. Executed in a subshell (like in a script) does not affect the main shell.
answered Nov 20 '17 at 21:29
Hauke Laging
53.6k1282130
53.6k1282130
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405853%2fpopulate-alias-db-from-a-bash-script%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
If I copy that into my shell I get three error messages.
â Hauke Laging
Nov 20 '17 at 21:28