cerebroapp / cerebro-shell

📦 Cerebro plugin to execute any shell command from Cerebro search line
18 stars 1 forks source link

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

Open valdotdev opened 7 years ago

valdotdev commented 7 years ago

Says "command not found". Normal commands works fine

matmunn commented 7 years ago

I've got this problem as well, using zsh

jeflora commented 7 years ago

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

KELiON commented 6 years ago

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 commented 6 years ago

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

voltuer commented 6 years ago

same problem one year after

fohrums commented 5 years ago

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 commented 4 years ago

no solution?

hofstede-matheus commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

Shoaib-Khan commented 4 years ago

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 commented 3 years ago

Still the same problem.