Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

printf in bash

printf "$your_var1 $your_var2 $(tail -n -1 your.log | grep Word_to_grep ) 
" >> ../opt_done.txt 

# several things, 
# printf with 
 new line
# $(tail -n -1 your.log | grep Word_to_grep )  --> is a command, will output whats comes in terminal
			(if final line of the document has "Normal" to grep it will grep, oherwise nothing 
# $your_var1 $your_var2 variables
# >> this is an appending,
Source by linuxhandbook.com #
 
PREVIOUS NEXT
Tagged: #printf #bash
ADD COMMENT
Topic
Name
6+9 =