You have syntax error in your if condition, use this if condition:
if [ "$EUID" -ne 0 ];
OR using [[
and ]]
if [[ "$EUID" -ne 0 ]];
More Related Contents:
- Correct Bash and shell script variable capitalization
- While loop stops reading after the first line in Bash
- How can I compare numbers in Bash?
- Pipe output and capture exit status in Bash
- Redirect stderr and stdout in Bash [duplicate]
- Why equal to operator does not work if it is surrounded by space?
- Which characters need to be escaped when using Bash?
- “~/Desktop/test.txt: No such file or directory”
- Capturing Groups From a Grep RegEx
- How to put a line comment for a multi-line command [duplicate]
- How to get a password from a shell script without echoing
- Exit Shell Script Based on Process Exit Code [duplicate]
- Pass all variables from one shell script to another?
- Checking if output of a command contains a certain string in a shell script
- Bash conditional based on exit code of command
- Simulating ENTER keypress in bash script
- How to make awk ignore the field delimiter inside double quotes? [duplicate]
- Passing arguments by reference
- Get just the filename from a path in a Bash script [duplicate]
- Rename multiple files in shell [duplicate]
- Is there a way to make bash job control quiet?
- Get current directory or folder name (without the full path)
- How do file descriptors work?
- Execute a shell function with timeout
- Convert Unix timestamp to a date string
- Using Bash to display a progress indicator (spinner) [duplicate]
- When does command substitution spawn more subshells than the same commands in isolation?
- Extract version number from a string
- How to properly nest Bash backticks
- Subtract two variables in Bash