I want to update my fish shell to use the current version of php from MAMP (which ever version is currently in use).
I found an excellent article on how to do this in bash, but I can't seem to work out how to achieve this in fish?
The article is: How to override the path of PHP to use the MAMP path?
Specifically:
# Use MAMP version of PHP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
How do you achieve this in fish? Fish wants to export PHP_VERSION
as a string.
And also using these commmand alias's to use current version of MySQL
# Export MAMP MySQL executables as functions
# Makes them usable from within shell scripts (unlike an alias)
mysql() {
/Applications/MAMP/Library/bin/mysql "$@"
}
mysqladmin() {
/Applications/MAMP/Library/bin/mysqladmin "$@"
}
export -f mysql
export -f mysqladmin
I have tried to figure out the various pieces of this, but having limited understanding of commandline makes it difficult to know what to 'search' for.
Appreciate any help!