Answers for "bash script name"

1

how to get name of pc bash script

computer_name=$(whoami)

if [ $computer_name == "NAME" ]
then
    echo "a is equal to b in NAME pc"
    echo $computer_name
else
    echo "a is not equal to b another pc"
    echo $computer_name
fi
Posted by: Guest on September-02-2021
0

bash get name of current script

# Basename accepts a file path followed by an optional suffix
me=`basename "$0"`
Posted by: Guest on September-13-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language