Skip to main content
2 of 6
Fix typos and capitalise first character in sentences
  • ./sab-find-db assumes that sab-find-db exists in your working directory. Why should it?
  • In the usage-output you should display the program name without path , so die "usage: $(basename $0) ....
  • Maybe it is more useful if you use different error codes and not only '1'.
  • A short comment at the beginning of the file about its purpose is useful.
  • sab-remove does not contain a usage message.
  • Most users assume that the option '-?' produces a usage message.
  • It is a good idea to use a named variable in the code and not a positional parameter. At the top of the function you assign the positional parameters to the named variables. If you change your parameter order or insert/delete new positional parameters you only have to change the first lines of your code.
  • mvas in mv "$file" target in sab-remove is not a good idea. "$file" replaces target, but not only the content is replaced but also the ownership and the permissions. Do cp "$file" target instaed of mv.
  • I do not understand the second if-then-else statement in add-remove. Does this mean you do not want to remove the last ntry in the file?
  • sab-find-db is a name that irritates me. I would prefer something like sab-dbpath.
miracle173
  • 1.3k
  • 6
  • 19