Difference between revisions of "$1"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
 
https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
  if [ -n "$1" ]; then
+
  [[if]] [ [[-n]] "$1" ]; then
 
   echo "You supplied the first parameter!"
 
   echo "You supplied the first parameter!"
 
  else
 
  else
 
   echo "First parameter not supplied."
 
   echo "First parameter not supplied."
 
  fi
 
  fi
 +
 +
 +
[[if]] [ [[-z]] "$1" ]; then
 +
  echo "First parameter not supplied."
 +
  echo "Usage: XXXXX"
 +
  [[exit 0]]
 +
fi
 +
 +
== Related ==
 +
[[echo $0]]
 +
[[ARG]] in [[Dockerfile]]
  
 
== See also ==
 
== See also ==

Latest revision as of 10:16, 8 April 2023

Advertising: