I created a Homestead installation for each project. I included after.sh (in the root directory) to provide other packages, such as RethinkDB, without problems, but the aliases file (also in the root directory), although it appears in the virtual machine as ~ / .bash_aliases, does not work from aliases when I introduce them. So, for example, these aliases:
alias artisan='php artisan' alias autoload='composer dump-autoload'
At the command line:
artisan migrate:refresh --seed autoload
Throw these errors away:
Could not open input file: artisan autoload: command not found
This happens for any of the aliases I'm trying to make. I checked that ~ / .bash_aliases (or / home / vagrant / .bash_aliases) exists using nano and this is definitely a copy of aliases. Itβs just that none of the commands is used, as if it did not exist or as if the file located in the right place is inaccessible.
Does anyone know why? or how to fix it? It's amazing how annoying it is the inability to use aliases that I usually use locally, or the global Homestead installation when using this virtual machine.
UPDATE
I noticed that I get a list of command not found errors when I enter SSH, which is equal to the number of aliases I added. The same list appears if I run source ~/.bash_aliases . For clarity, .bash_aliases is located in /home/vagrant next to the displayed source folder /home/vagrant/app , and SSHing output to VM and its associated alias file:
SSH in VM
$ vagrant ssh Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64) * Documentation: https://help.ubuntu.com/ Last login: Mon Feb 15 00:37:39 2016 from 10.0.2.2 : command not found : command not found : command not found : command not found : command not found : command not found : command not found : command not found : command not found : command not found vagrant@app :~$
Alias ββfile
# Homestead -------------------------------------------------------------------- alias ..="cd .." alias ...="cd ../.." alias h='cd ~' alias c='clear' alias phpspec='vendor/bin/phpspec' alias phpunit='vendor/bin/phpunit'
After.sh File
UPDATE 2
The nano output is .bash_aliases , which looks like my alias file, but the result after that alias truncates the first letter of the aliases.
# Homestead ---------------------------------------------------------------------- alias ..="cd .." alias ...="cd ../.." alias h='cd ~' alias c='clear' alias phpspec='vendor/bin/phpspec' alias phpunit='vendor/bin/phpunit'
Exiting simple alias input to terminal:
vagrant@app :~$ alias 'lias ..='cd .. 'lias ...='cd ../.. alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 'lias artisan='php artisan 'lias autoload='composer dump-autoload 'lias c='clear alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' 'lias h='cd ~ alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias ls='ls --color=auto' 'lias phpspec='vendor/bin/phpspec 'lias phpunit='vendor/bin/phpunit 'lias tinker='php artisan tinker --env=local
FINAL DECISION
Thanks to @JoshRumbut for solving this problem, see his comments below.
vagrant@app :~$ tr -d '\r' <~/.bash_aliases >~/tmp vagrant@app :~$ mv ~/tmp ~/.bash_aliases vagrant@app :~$ unalias -a vagrant@app :~$ source .bash_aliases