Skip to main content
added 7 characters in body
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

I have a piece of code like this:

count=0 until [ -f $filename -o $count -ge 60 ] do count=$((count+1)) sleep 1 done

count=0
until [ -f $filename -o $count -ge 60 ]
do
  count=$((count+1))
  sleep 1
done

I know [ -f $filename -o $count -ge 60 ][ -f $filename -o $count -ge 60 ] is a test command, "-f $filename" tests if the file exists or not, "$count -ge 60" tests if count is greater than or equal to 60, what does "-o" mean?

I googled, can't find the answer, anyone can help? Thanks in advance.

I have a piece of code like this:

count=0 until [ -f $filename -o $count -ge 60 ] do count=$((count+1)) sleep 1 done

I know [ -f $filename -o $count -ge 60 ] is a test command, "-f $filename" tests if the file exists or not, "$count -ge 60" tests if count is greater than or equal to 60, what does "-o" mean?

I googled, can't find the answer, anyone can help? Thanks in advance.

I have a piece of code like this:

count=0
until [ -f $filename -o $count -ge 60 ]
do
  count=$((count+1))
  sleep 1
done

I know [ -f $filename -o $count -ge 60 ] is a test command, "-f $filename" tests if the file exists or not, "$count -ge 60" tests if count is greater than or equal to 60, what does "-o" mean?

I googled, can't find the answer, anyone can help?

Source Link

Bash script: test command -o option

I have a piece of code like this:

count=0 until [ -f $filename -o $count -ge 60 ] do count=$((count+1)) sleep 1 done

I know [ -f $filename -o $count -ge 60 ] is a test command, "-f $filename" tests if the file exists or not, "$count -ge 60" tests if count is greater than or equal to 60, what does "-o" mean?

I googled, can't find the answer, anyone can help? Thanks in advance.