Bash script name & path
This commit is contained in:
parent
9b63bbef61
commit
4b17968cc9
@ -3,3 +3,4 @@
|
||||
* [UnixSocket сервер на `nc`](unix-socket-server.sh)
|
||||
* [Проверка наличия команды](command_exists.s)
|
||||
* [Проверка наличия файла/директории](file_folder_exists.sh)
|
||||
* [Получить путь ии имя скрипта](get-name-and-path.sh)
|
||||
|
7
code/Bash/get-name-and-path.sh
Normal file
7
code/Bash/get-name-and-path.sh
Normal 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"
|
Loading…
Reference in New Issue
Block a user