from the comments, it became clear that by “current directory” the author means the directory in which the script itself is located.
usually, the path to the shell script (containing the name of the script itself) is passed to the script itself as a “zero” parameter: $0 .
extract the directory path from it, i.e. discard the file name (with the script), the easiest way is using the dirname program (quotes should be used in case there are special characters like $0 in $0 ):
current_dir=$(dirname "$0)
in principle, this is already enough to address the directory, but in case the script is run with an indication of a relative path (for example, ./скрипт ), and you need to get an absolute path, you can use the realpath program:
abs_path=$(realpath "$(dirname "$0")")
PATHvariable? - aleksandr barakinPATHis an environment variable . pwd is an internal shell command. naturally, it works. so what's not working for you? - aleksandr barakinunknown command current_dir- Anton