I know this must be something silly but somehow I am stuck trying to create a shortcut (alias) for a shell function.
Here is my exact .bash_profile
:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* alias l="ls -G" r () { echo "iron_worker upload $1" echo "iron_worker queue $1" } export -f r
So I've added my function r()
at the end of the file. Now when I type r
in the shell, I still get error:
-bash: r: command not found
I have restarted terminal, shell window, and still no effect.
I am on Mac OS 10.8.5 if that matters.
EDIT.
After some searching found this question suggesting to use bash_profile
instead of bashrc
, which is now working! But ... what I get are the commands listed but not executed:
Dmitris-MacBook-Pro:~ dmitrizaitsev$ r iron_worker upload iron_worker queue
This the normal command execution that I expected:
Dmitris-MacBook-Pro:~ dmitrizaitsev$ iron_worker upload Please specify code package name or path to workerfile usage: iron_worker upload CODE_PACKAGE_NAME_OR_PATH_TO_WORKERFILE [OPTIONS] -n, --name NAME override code name -c CONCURRENCY, max number of concurrent workers for this code package --max-concurrency -r, --retries NUM_RETRIES max number of automatic retries on task fail -d RETRIES_DELAY, delay between each automatic retry --retries-delay --worker-config CONFIG_FILE config file for worker -h, --host HOST host name, eg: www.mydomain.com -a, --async don't wait for package build --full-remote-build activate full remote build --config CONFIG config file -e, --env ENV environment --project-id PROJECT_ID project id Dmitris-MacBook-Pro:~ dmitrizaitsev$
Instead I am only getting the command and nothing else. Any idea what is going on?
~/
and the content is as in the question. Is that what you mean?