want to exit after tail command in unix
12,738
You can use this sed
instead to exit as soon as text
is found:
sed '/text/q' <(hadoop fs -cat /input-path/*)
Author by
Mars
Updated on June 04, 2022Comments
-
Mars almost 2 years
I am using shell scripts , which performs following command
hadoop fs -cat /input-path/* | grep "text" | tail -1
I want to exit after this command, so that my shell scripts will execute another command.
-
Mars over 9 yearsit's exiting now , but grep is not working properly.
-
anubhava over 9 yearsEven
awk '/text/{print; exit}' <(hadoop fs -cat /input-path/*)
also works.