Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliases set in ~/.bash_profile not recognized on macOS #6

Open
valdotdev opened this issue Feb 14, 2017 · 12 comments
Open

Aliases set in ~/.bash_profile not recognized on macOS #6

valdotdev opened this issue Feb 14, 2017 · 12 comments

Comments

@valdotdev
Copy link

Says "command not found".
Normal commands works fine

@valdotdev valdotdev changed the title Aliases set in ~/.bash_profile not recognized Aliases set in ~/.bash_profile not recognized on macOS Feb 14, 2017
@matmunn
Copy link

matmunn commented Mar 7, 2017

I've got this problem as well, using zsh

@jeflora
Copy link

jeflora commented Sep 13, 2017

Same problem on Ubuntu 16.04, it does not recognize alias set in ~/.bash_aliases.

@KELiON
Copy link
Collaborator

KELiON commented Sep 18, 2017

I'll try to check it, but I think we just have to include .bash_profile on initialization, before executing script, that user enters

@specialk01
Copy link

Any updates on this? I am lacking the coding skills, but this would be a huge improvement for me.

@voltuer
Copy link

voltuer commented Mar 24, 2018

same problem one year after

@fohrums
Copy link

fohrums commented Oct 2, 2018

I'm experiencing aliases not being recognized when using MacOS as well. Many discussions about the following files relating to bash* is all over the place (see below). The issue here is there's no explanation of what each file represents and how it's co-related to other files within the home directory. What's more confusing is how there's bash* related files within /etc/ directory also. How do I set terminal-aliases in mac and not in a way that's automatically run every time you launch terminal window?

Home Directory bash-related files
~/.bash_aliases (meant to have aliases, but isn't recognized)
~/.bash_profile (meant to autorun commands when terminal opens which is working for me but can't run those aliases after initial launch)
~/.bashrc (???)
~/.profile (???)

An alias example would be to do a task that takes longer if typed out manually as opposed to a keyword that can run that very same long command (like so):

alias editthisfile=cd /etc/bashrc && vim ./bashrc if not working use next one, but it's up to you to edit the METHOD of doing things. use this instead if previous isn't working alias editthisfile=nano /etc/bashrc

@hofstede-matheus
Copy link

no solution?

@hofstede-matheus
Copy link

I'll try to check it, but I think we just have to include .bash_profile on initialization, before executing script, that user enters

please explain how to do this

@hofstede-matheus
Copy link

hofstede-matheus commented Dec 12, 2019

I could not make it read aliases, but creating a shell script in /usr/local/bin (or any other bin location), solved my problem with running custom commands on Cerebro.
Here is my file named upper

#! /bin/bash
a=$1
b=`echo "print '$a'.upper()" | python`
echo "$b"

So running upper lower_case_string, outputs LOWER_CASE_STRING

@voltuer
Copy link

voltuer commented Dec 23, 2019

why are you trying zsh to read bash files? just put the aliases on .zshrc

@Shoaib-Khan
Copy link

Recently hd the same problem, @sebolio comment helped me.
I created a .zshrc file and ran my .bashrc file(containing alias) from this file as following

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

@ghost
Copy link

ghost commented Sep 28, 2020

Still the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants