I have a .sh file in bin folder, but when I try to use it, the server cannot find it in the folder.
checkServer.sh etf_disagg_config_loader.sh getLogName.sh mapr
common.sh findLog.sh jgrouplog.sh phase2b
commonStart.sh findServer.sh jmx postInstallSetup.sh
errorLog.ksh followLog.sh jrebel.sh probe.sh
etf genTestFile.ksh killServer.sh RMSDisable.sh
bash: stopServer.sh: command not found
while when I use
/home/monju/full/app/bin/stopServer.sh, it can be used.
Just because it’s in a directory named
bin doesn’t mean the shell can magically find it.
You need to put the full path in your
$PATH environment variable, or symlink it to somewhere that’s in the
Of course, if you only want to run it from the current directory, it’s best to use
Which is the same as the long absolute path you gave, only using relative path syntax where
. means current directory.
. itself in
$PATH is considered bad practice.
and make sure you have execution rights.