When I was running the command in terminal of linux then that command worked and necessary files are created but when I ran that command in shell script then the script is showing the message like "The tool is not in path. FATAL error". Can anyone help me why this is happening when I am running the commands through Shell script?
Command is : /remote/system/vdk/2019.06/bin/icv -i -c -f GDSII | tee drc.log
Is this the problem with tool that it is only running on terminal, but not when we running the same by mean of scripting? Can anyone help me?
Related
I'm having the following issue. When I execute this command sfdx profile:field:add -n "Account.Test" -m re -p "Test" from a Bash script, it's all fine.
However, when I try to execute the following:
sfdx profile:field:add -n "Account.Test" -m re -p "Test Test"
I get this error: 'C:\Program' is not recognized as an internal or external command
When I run the same command in the terminal, it works fine. It's just when I put it inside a bash script that this error happens.
Currently running this on Windows 10.
I'm 100% sure it's the space in that last parameter, I am just not sure how to get around it. Can anyone help?
I've wrote a shell script file on mac to deploy some docker application. But when I copy it to Windows10, it seems that it cannot run properly.
The path after "docker exec xx /foo/bar" is always transferred into an absolute path in windows, and leads to an error like: "sh: D:/DevTools/Git/root/start_zk.sh: No such file or directory".
What's more, when executing "docker exec xx /foo/bar" in powershell or git bash, it can run properly. This problem only occurs when I write it into a file, and run it through "sh deploy.sh".
I've tried to add "\" before "/", but it doesn't help. My code is listed below.
echo "deploying zookeepers..."
docker exec ac sh /root/start_zk.sh
Is there any fault in my script? The command "sh /root/start_zk.sh" after "docker exec" should be a parameter for the docker container to execute, but it seems that it is recognized by windows as a command or path. Is there any way to solve this?
Hi i have created a batch file (run.bat) that after execution connects me to UNIX server with help of plink. But issue starts from this point i have to execute a script after connection to my server the script contains a command sudo -l. After the execution i get the error as mentioned in subject can anyone help me on this issue ??
Batch File-:
"C:\Program Files\PuTTY" plink -ssh -pw Tos#12Ts w44dvftyw#caa1607UX009.wvd.abcd.net /opt/sieb/w44dvftyw/run.sh
Script file(run.sh) -:
#!/bin/bash
sudo -l
It says
sudo: command not found
But when i run my script normally on UNIX server it runs with no issues. What am i missing here to make it work this way please help.
Scripts such as ~/.profile or ~/.bash_profile responsible for setting up the current user's PATH are run only on login shells.
Running sh -c 'somescript' (as performed by ssh host 'somescript') is neither a login shell, nor an interactive shell; thus, it does not gain the benefit of such scripts.
This means that additions to the PATH (in your case, /usr/local/bin) may not be present with commands run in this way.
Among your options:
Pass the PATH you want as part of the command to remotely run. This might look like:
plink -ssh user#host "PATH=/bin:/usr/bin:/usr/local/bin /opt/sieb/w44dvftyw/run.sh"
Embed a working value in the script you're running:
#!/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
# ...put the rest of your script here.
I'm using SNMPD to run a script on a Raspberry Pi with net-snmp.
I was able to get the same script running on my Slackware machine, but on the Pi, under extOutput.1, I'm getting "Exec format error".
The batch file being called is set to 777 and is:
#! /bin/bash
/sbin/reboot
Everything I've found about the error says that I would just need to include the #! at the beginning of the file and that would fix it, but it doesn't. I can run the script from the command prompt just fine, and /bin/bash obviously works also, but when called through SNMP (both snmpget and snmpwalk), the extOutput.1 line gives me that error.
Ugh. I had a blank line at the top of the script before the #! line.
I have the following shell script (bash script) at cron.sh file
#!/bin/bash
WORKON_HOME="/home/django/domains/example.com"
PROJECT_ROOT="/home/django/domains/example.com/django-project/"
. $WORKON_HOME/bin/activate
cd $PROJECT_ROOT
python manage.py cron
But when i run:
$ sh cron.sh
I got the following error
: not found
: not found
/bin/activatepen /home/django/domains/example.com
Server info
cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
What am I doing wrong?
Your script has the wrong line endings. Pass it through dos2unix.
Well, you didn't show us everything in the code that you're trying to run. So I'll answer generically instead:
Run the script using sh -x cron.sh which will give you very verbose output of what it's doing up until the python invocation. If the errors are before that point, you know it's in the sh half and what caused them. If after that, you'll have to debug the python script.
Try using
bash -x cron.sh
or
./cron.sh
make sure to make it executable.