linux - . / instead of / in crontab -
i'm having error while trying execute sh in crontab (or in normal shell) . made user xuser, , in home directory make symbolic link /opt/app /opt/app --> drwxrwxr-- xuser test in folder save serveral sh , jar.
now in crontab of user or in shell if tried execute this:
./opt/app/bin/ind.sh -bash: ./opt/app/bin/ind.sh: no such file or directory
the sh file
#!/bin/sh export java_home=/usr/java/latest/ export path=$path:$java_home export path=$path:$java_home/bin java -jar /opt/app/bin/ind.jar
if put space between . / works
. /opt/app/bin/ind.sh : command not found error: unable access jarfile /opt/app/bin/ind.jar
( access sh seems problem pass jar hahaha )
someone notice problem??
thanks !!!
there big difference, when put space between .
, /
.
no more part of file path alias of source
, means "execute content of file in current shell".
// execute in subshell ./foo/bar/baz.sh // execute in shell . ./foo/bar/baz.sh // not same file previously, unless @ root (/) . /foo/bar/baz.sh
Comments
Post a Comment