Skip to main content
edited tags; edited title
Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k

check if input is valid Check that a bash script has exactly two arguments which are directories

added 1 character in body
Source Link
slm
  • 379.8k
  • 127
  • 793
  • 897

I'm writing a bash script that compares two directories, but I'm not sure how to check conditions

For example, if the user enters 1 arg instead of 2  (we need 2 since we're comparing two directories), it should give an error. If both arg are valid, compare the directories and output to a file.

I'm writing a bash script that compares two directories, but I'm not sure how to check conditions

For example, if the user enters 1 arg instead of 2(we need 2 since we're comparing two directories), it should give an error. If both arg are valid, compare the directories and output to a file.

I'm writing a bash script that compares two directories, but I'm not sure how to check conditions

For example, if the user enters 1 arg instead of 2  (we need 2 since we're comparing two directories), it should give an error. If both arg are valid, compare the directories and output to a file.

Source Link
asura
  • 309
  • 2
  • 4
  • 8

check if input is valid

I'm writing a bash script that compares two directories, but I'm not sure how to check conditions

For example, if the user enters 1 arg instead of 2(we need 2 since we're comparing two directories), it should give an error. If both arg are valid, compare the directories and output to a file.