When you see ./script being used it telling the shell that the script is located on the same directory you are executing it. To use full path you type sh /home/user/scripts/someScript .
A path is a location to a directory or a file. There are two distinct types of paths in Linux – absolute and relative. The relative path is determined using the current working directory. On the other hand, the absolute path is the full path to a file or directory.
Is it possible to find out the full path to the script that is currently executing in KornShell (ksh)?
i.e. if my script is in /opt/scripts/myscript.ksh
, can I programmatically inside that script discover /opt/scripts/myscript.ksh
?
Thanks,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With