I agree it doesn't seem like a very well organized course, and your code samples to date seem to indicate that you've just jumped into the deep end of the pool, e.g.:
Quote:
Originally Posted by jeffrey1289
Code:
if length "$line" | grep '^[^;]' > max
max=length "$line" | grep '^[^;]'
|
That is so far removed from any syntax I know that I can't even tell what language it's supposed to be.
Just some useful hints:
Code:
Matcher="^([^;].*[^ ]) *(;.*)" # A regular expression to match a string beginning with something other
# than a semicolon, followed by a string of any characters up through
# the last non-space character that is then followed by any spaces and
# a semicolon then followed by any number of characters. (Whew!)
if [[ $Line =~ $Matcher ]]; then # If line contains both code and comment
Code="${BASH_REMATCH[1]}" # First parenthesized segment is just the code w/o trailing spaces
Comment="${BASH_REMATCH[2]}" # Second parenthesized segment is the comment
Code_length=${#Code} # Length of $Code
.
.
.
fi