================================== Marking Code comment abbreviations ================================== -IAN! idallen@ncf.ca I use these abbreviations when marking your shell scripts: abs - use absolute pathnames blk - not enough or too many blank lines bsl - incorrect or redundant use of backslash (\) cat - superfluous use of "cat" command (not necessary) com - missing or incorrect comments dup - unnecessary, duplicate code - simplify your algorithm ind - missing or incorrect use of indentation (in control structure?) mih - missing header line (interpreter, syntax, purpose, or author) mis - missing code required by specification msg - message (usually "missing error message") mp - missing pipe (output should be piped to next stdin) nae - not an error (do not print on stderr or treat as an error) nnc - not necessary (probably correct; but, should be left out) nsp - no such pathname (incorrect path to file or directory) obv - obvious comment (does not add to program understanding) pum - missing or incorrect PATH and umask quo - incorrect use of quoting (including missing quotes) rel - use relative pathnames ser - should appear on standard error sim - code is too complex; simplify sla - incorrect use of slash (/) slr - correct but redundant use of slash (/), often in front of /$HOME sp - incorrect spelling or punctuation spc - incorrect use of unescaped special character unk - unknown purpose (code, comment, or syntax) xbl - extra blanks If you don't understand why I made the comment, come see me. Some typical errors: #/bin/sh command args args | >outfilename command args args | /outfilename tr ' ' '/n' tr '' '\n' rusers acadaix chmod o=-wx file chmod u-rwx g-wx o-x /user/bin echo "$pwd" /.dotdir /top /test_two umask=022 export Path=/bin:/usr/bin md dirname grep "$0" - not setting execute permissions on the script - making the script generally writable by others (e.g. 777) - not including a comment showing the correct syntax (command arguments) - forgetting which directory was current when issuing commands - forgetting either the verb or object in a command line, e.g. bash$ $HOME -- missing verb bash$ chmod 700 -- missing object - using a blank line instead of a #!/bin/sh interpreter line - putting a blank in front of #! in the interpreter line - putting a blank between # and ! in the interpreter line - missing # or ! in the #! interpreter line (e.g. #/bin/sh or !/bin/sh) - using mv or cp instead of ln to make a new name for the same file - using cp instead of mv to rename something - redirecting all echo output to stderr, leaving none on stdout - mis-spelling file names, directory names, script names, and command names - using temporary files in the current directory instead of a pipeline (you can't be sure that you can write in the current directory!) Correct but cumbersome (you can do it more simply): command ./pathname or "$(pwd)"/pathname or "$PWD"/pathname command /"$HOME"/pathname echo "$PWD" cd ~ cd "$HOME" - using "/usr/sbin/link" (available on IBM Unix only) instead of "ln" - using temporary files in /tmp/ instead of a pipeline "Less code is better code"