my script:
FILE="$1"
echo "You Entered $FILE"
if [ -f $FILE ]; then
tmp=$(cat $FILE | sed '/./!d' | sed -n '/regex/,/regex/{/regex/d;p}'| sed -n '/---/,+2!p' | sed -n '/#/!p' | sed 's/^[\
]*//' | sed -e\
s/[^:]*:// | sed -n '/==> /!p' | sed -n '/--> /!p' | sed -n '/regex/,+1!p' | sed -n '/======/!p' | sed -n '/regex/!p' | sed -n '\
/regex/!p' | sed -n '/regex /!p')
fi
MyVar=$(echo $tmp > my.txt)
FILE2="$2"
if [ -f $FILE2 ]; then
tmp2=$(cat $FILE2 | sed -n '/regex/,/regex/{/regex/d;p}' | sed -n '/#/!p' | sed -e s/[^:]*:// | sed /--------/,+10d)
fi
echo "You Entered $FILE2"
MyVar2=$(echo $tmp2 > my2.txt)
var=$(echo hi2.txt | sed '/^$/p' )
echo "$var"
cmp -b my.txt my2.txt
i know, i know. thats a long pipeline..my problem is that i cant seem to include anywhere in it to be able to double space it. sed G sed '/^$/p' or awk, they just really doesnt register. the sed pipeline is to long for me to do that.. ..
Anyways , what i have looks similar to the paragraph that i just typed. And probably this one when im through. the exception to this and my text file is that it has valid commands. nothing else. So it makes sense for me double space the file iim talking about and then somehow to use a loop to execute each line ( contaiing the comands ) .
i really struck. i really need help.