Difference between revisions of "$1"

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

Latest revision as of 10:16, 8 April 2023

Advertising: