I'm trying to do the following:
vim +$line $LEDGER
But instead of opening at the line number it's opening two files, one the number and the other the actual file I want to open.
Probably, there is leading whitespace before the number in $line
. There are several ways to fix this:
$ vim "+$line" "$LEDGER"
Note that it's always a good practice to quote variables, even if they currently don't contain whitespace or other problematic characters.
$ vim +${line# } "$LEDGER"
wc -l $LEDGER
and didn't realize it was adding the filename onto the output. I switch to wc -l $LEDGER | awk '{print $1}
$line
and$LEDGER
are defined?$ echo $line $LEDGER
.$line
has leading whitespace.