Bash script name & path

This commit is contained in:
Alexander Popov 2024-03-28 17:39:03 +03:00
parent 9b63bbef61
commit 4b17968cc9
2 changed files with 8 additions and 0 deletions

View File

@ -3,3 +3,4 @@
* [UnixSocket сервер на `nc`](unix-socket-server.sh)
* [Проверка наличия команды](command_exists.s)
* [Проверка наличия файла/директории](file_folder_exists.sh)
* [Получить путь ии имя скрипта](get-name-and-path.sh)

View File

@ -0,0 +1,7 @@
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
echo -e "\033[0;31mPath:\t\033[1;31m$SCRIPTPATH"
echo -e "\033[0;36mName:\t\033[1;36m$SCRIPT"