I want to create and then use an alias in a function of a sourced Bash script. I've run into Inception-like difficulties and I would appreciate pointers on how to do this properly.
Here's a sample script to source:
#!/bin/bash
myFunction(){
alias zappo="echo"
zappo
}
Any suggestion?
Note that aliases will have limited functionality for scripting. From the Advanced Bash Scripting Guide:
I would use a variable for this:
Or even a wrapper function:
now call it like this: