That command will give you
only the number.
Example where the longest line in theFile.txt is 18 characters:
Code:
$ ./myscript.sh theFile.txt
theFile.txt
18
Content of myscript.sh:
Code:
#!/bin/bash
FILENAME="$1"
echo $FILENAME
LONGESTLINE=`cat "$1" | wc -L`
echo $LONGESTLINE