I have setup my localhost on macOS big sur with apache and php (works fine). I now have a bash script that uses ant to build some source code, but I cannot run the ant command from within a bash script from the browser. I always receive ant: command not found. I can run the bash script from the terminal with my user and the webuser (_www) ant this works as intenden. But I cannot get it to work when I call the site from my browser. Any ideas?
Related
I am using Ubuntu Linux 20.04
I am using an application named InstaSafe Agent which connects me to a VPN.
App Logo:
I want to automate this login process.
For that, I am looking for bash command to run this application from terminal.
this is how it looks when I open this application.
I have tried to find its installation path like this.
Command: whereis instasafe
output: instasafe: /etc/instasafe
Can Someone let me know how can I run this application using bash command?
If you have installed InstaSafe using default settings,
you can try this command.
This worked for me.
/usr/bin/java -jar /opt/instasafe/isaagent-1.0.jar
I have successfully installed wp-cli on my remote server and created the "wp" alias. I use Putty to connect via SSH, and everything works just fine. First, I used a .user_bashrc file to set the alias with:
alias wp='/www/htdocs/w019d58a/wp-cli.phar'
The path is set in .user_bashrc using:
export PATH=/www/htdocs/w019d58a/:$PATH
However, when I tried to run wp-cli from a bash script, I got a "wp command not found" error. I contacted the support, and they recommended a symlink. So, I created a symlink using:
ln -s /www/htdocs/w019d58a/wp-cli.phar wp
Everything works but the installation process. I can, for example, install a plugin using:
#!/bin/bash
wp plugin install akismet
Unfortunately, I can't download WordPress via the bash script using:
wp core download --locale=de_DE_formal
I always get the error:
Error: Too many positional arguments:
Error: This does not seem to be a WordPress installation.
Pass --path=path/to/wordpress or run wp core download.
I tried to add the path using:
wp core download --locale=de_DE_formal --path="/www/htdocs/w019d58a"
No luck. I stil get the same error.
I can download and install WordPress directly from the console and do further operations using a script. But I can't download and install it from the script due to the path error.
Any ideas how to fix that?
I've just found out, that the download is working fine:
#!/bin/bash
wp core download --locale=de_DE_formal
It's the config create part that causes trouble:
wp config create --dbname=d123456 --dbuser=d123456 --dbpass=123456 --dbhost=localhost --dbprefix=wplcli_
I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server.
Here is the script I am running through slather
slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home/workspace/TestApp/TestApp.xcodeproj
Here is the PATH variable I am setting while executing this shell
$PATH:/Users/Shared/Jenkins/.gem/ruby/2.4.0/bin
Finally fixed this issue by running the following shell command using Jenkins.
$Home/.rvm/gems/ruby-2.4.1/wrappers/slather
Earlier, I was referring to
$Home/.rvm/gems/ruby-2.4.1/bin/slather
and the bin does not have ruby environment support when executed via shell script.
Trying to execute a script on the remote aws centos machine using the command mentioned below
ssh root#hostname script
Everything works fine until the script comes to a maven command. For example "mvn package" in the script. Getting the error below.
bash: mvn: command not found
I have a php script on my hosted linux/unix server.I want to create a CLI for windows/linux both for executing my PHP script.
for linux i can create a shell script that can execute my php script by using methods like url,curl).
But how can i execute php script from a windows CLI (batch file). If any good suggestion for Linux CLI would be appreciated.
Thanks,
Pankaj
You can download sh.exe (Bash) for win32 which will let you run the same script on both platforms. On windows then you only need to do sh.exe script.sh
I use this method all the time because BAT programming is such a futile and terrible exercise in time-wasting.
http://unxutils.sourceforge.net/
EDIT: Oh wait, I thought you were trying to run a PHP script on a website (ie, via wget). I'm not sure what the implications of running PHP as CLI on win32 are.