Does anyone know of a simple one liner to read the first line of a file in bash?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
Same result as the other answers but faster because it doesn't spawn any process, as "read" is a built-in bash command. |
|||
|
|
Stores the line in a variable for later use (note the inverted apostrophes). |
|||||||||||||||||
|
|
|||
|