commands for bash script that handles files of varying number of lines
Need commands for bash schell script that handles files varying in number of lines.
|
You can use wc to get the number of lines in a file (the option -l does this). Edit: you can also store the output of a command in a variable with syntax like this:
variable=`command` For example, to put the number of lines in the file foo in a variable called num_lines, you'd use the following: num_lines=`wc -l foo` |
All times are GMT -5. The time now is 07:51 PM. |