Hi All,
I copied an existing script so that I could make updates to it and test those updates.
In both scripts I set the path which is the exact same in both scripts as I copied from the old to the new script.
setting path is this command:
Code:
# Add the path required for EMC commands to run correctly
export PATH=$PATH://usr/bin:/etc:/usr/sbin:/usr/local/bin:/usr/symcli/bin:/usr/emc/sc
I have a bash script that works with relative paths. It needs to have a working directory that is equal to the directory the script is stored in. This works fine as long as I start it from the prompt, because I can cd to the script's directory first.
I would like to add some python script to path.
I can add bash scripts to folders in my path and then execute them from everywhere.
When I do so with python script, I can only execute them when I am in the same directory.
I have some script in my $HOME/bin folder.
When I access my machine remotely I can't use them and I can't understand
why. They work just fine when I'm in front of my remote computer.
I think it might have something to do with the .bashrc file..
Hi,
Im trying to run script A which requires path /sbin.
I have a crontab entry to run script A every 10 minutes.
Script A is executed fine by cron, but because script A requires /sbin in its path it fails to run.
My situation is script A get overwritten from time to time so I can't modify script A to set path in there.
So my question is...
I have an issue driving me bonkers. I have a ksh script that requires changing directories. If a argument "TEST" is passed in, this is a regression test execution of the script (as opposed to production execution). I have a directory entitled "TEST" that is located three directory locations ABOVE where the script resides.
how can i get the absolute path of whatever directory a script and/or command is in when it is run?
i want to know the directory. say for instance, if i were to run the "who" command, i want to know exaclty where the who command is located.
if a user ran a script, i want to know where there script is located.
can this be done in a script?
shell: bash
os: linux / sunos
I made a bin directory in my home folder where I place all my scripts. Then in my .bashrc I added the following:
export PATH=$PATH:/home/myusername/bin
So I could access files I placed in there from anywhere. But some of the scripts need to be executed as root.
I trying to pass a Perl script over SSH that takes arguments. I works fine like this:
returnValue=$(ssh myuser$server 'perl -s' < /path/to/my/script)
However, if I add some arguments
returnValue=$(ssh myuser$server 'perl -s' < '/path/to/my/script -some argument')
I get an error "/path/to/my/script -some argument: no such file or directory".
Does anyone know how to do this?
Thanks!