Check this link for more detail: The Magical container_of() Macro
#ifndef container_of
#include
#define container_of(ptr, type, member) ({
const typeof( ((type*)0)->member )
* __mptr = ((void*)(ptr));
(type*)( (char*)__mptr -
offsetof(type, member) );
})
#endif
Use grep, Check With https://en.wikipedia.org/wiki/List_of_file_signatures
grep -a -o -e $'GIF8' -e $'\xFF\xD8\xFF' -e $'\x89PNG' filename
Use sed to append command to insert corresponed line into file
function CreateNewDay()
{
LineNo=`grep -n content index.html |head -1| cut -b 1,2`
sed -i "$LineNo a${1}" index.html
let LineNo=LineNo+1
sed -i "$LineNo a${2}" index.html
let LineNo=LineNo+1
sed -i "$LineNo a${3}" index.html
}