DEV Community

Discussion on: Writing Bash Scripts Like A Pro - Part 1 - Styling Guide

Collapse
 
wrp profile image
William Pursell

Unless newer versions of bash are playing fast and loose with the language, '
if [ "$USER_NAME" = "Julia" || ..' is an error. You could write if test "$USER_NAME" = Julia || ..., but the [ command requires that its final argument be ]. The || is not an argument.

Collapse
 
unfor19 profile image
Meir Gabay • Edited

Superb comment, I never use single [ ] brackets, so I'm less familiar with how it all works. I'll fix my answer to fit the proper syntax, thanks!