-4

I am going through one script and found this:

#!/bin/bash
set -o pipefail
if [[ $# -ne 1 ]]
if [ $? -eq 0 ]
wish
  • 67
  • 8

1 Answers1

1

$# is "amount" of positional parameters

example:

./script.sh foo bar

here we have 2 positional parameters (foo and bar)

this code checks if positional parameters "count" is not 1

nickmarko
  • 71
  • 6