SyntaxFix
Write A Post
Hire A Developer
Questions
You dont need any external command if you have bash v4+
< file.txt mapfile -n1 && echo ${MAPFILE[0]}
or if you really want cat
cat
cat file.txt | mapfile -n1 && echo ${MAPFILE[0]}
:)