1

I found a weird thing:

When I do in the console,

alias a='echo aaa'
a

I get the output aaa as expected. But when I do a script, let's name it script.sh

#!/bin/bash
alias a='echo aaa'
a

and run it by doing bash script.sh, I get script.sh: line 2: a: command not found

How is this possible and how can I fix it?

karlosss
  • 507

0 Answers0