Hello! I have this set of piped commands:
grep -n '*' file.txt | head -n1 | awk -F\: '{print $1-1;}'
It tells me the previous line to that where it first find asterisks. Now I want to get the previous lines piping that to:
head -n<that previous line number>
Head requires a number following immediately the -n argument, without spaces, for example:
head -n4
How can I do that? It just won't accept adding
| head -n
at the end of the set of commands. My searches have been fruitless. Thanks!