I have a binary that repacks android kernel (not mkbootimg). I'm making a script to automate the process.
I don't want any output on the screen. So I have redirected the output to a file named foo.log.
The command is - kernel_make "$zImage" "$ramdisk" "$cmdline" "$image" &> data/local/working/foo.log
My current working folder is data/local/working/
.
What I've to do is, if the last line of the output (foo.log) is this -
"targed file $1 is patched sucesfully, enjoy new kernel"
Then return 0 and exit. Else return 1 and exit.
I'm trying to do with grep, but as I'm new to command line, do don't have any idea of doing it the right way.
kernel_make
(script?) that should return the exit status, or the command line as a whole? – user367890 Jan 23 '15 at 15:45targed file $1 is patched successfully, enjoy new kernel
should be matched. @user367890kernel_make
is binary like mkbootimg that repacks kernels. – Chinmay Jan 23 '15 at 16:10kernel_make
is likely already exiting with 0 on success or <> 0 on failure if that helps. – user367890 Jan 23 '15 at 16:20