Difficulty executing commands in the shell script
-
Hello everyone I'm having trouble running some command lines in my shell script:
#!/bin/sh # cd Cloud/laradock && docker-compose stop open -a mail open -a whatsapp open -a slack cd ~/Cloud/laradock && docker-compose up -d nginx mysql postgres mongo redis open -a google\ chrome http://dev.laravel.library code -n ~/Cloud/Dropbox\ \(Personal\)/Projects/Caju/PHP/Frameworks/Laravel/Library/ open -a memory\ clean\ 2
All lines that start with the open command execute normally, but the lines that I access a folder to run the docker-compose and the line where I execute the command to open a folder in vscode using the code does not work.
Has anyone ever experienced this, thanks?
-
In the shell script you must not have all of your normal aliases and environments variables available, so you'll generally need to specify the full path to things. Like for vscode, this works:
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code -n ~/Desktop
Or this:
/usr/local/bin/code -n ~/Desktop
You can type this command to find the path for docker-compose:
which docker-compose
-
Hello russ, thank you very much it worked perfectly.
Thank you.
-
@Alcir-Junior, awesome.