Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5060

sed doesn't accept my variable to parse a file

$
0
0

I'm trying to read this config file :

#[TABLE]pattern1DISK_MAINPART_EFIPART_SWAPPART_ROOTpattern2#[END_TABLE]... rest of the file

I figured i had to use sed but so i researched on how to do it and saw this example :

val1="pattern1"val2="pattern2"sed -n "/^$val1/,/^$val2/p;/^$val2/q" $file

but once i change val1 and val2 to another thing it doesn't work anymore, i thought it was the special characters so i removed the #[] but it done noting can someone help me, I'm terrible at understanding regex stuff with my dyslexia ( it's also hard for me to go trough heavy documentation, that's why i ask that kind of stuff ).Thanks in advance.


Viewing all articles
Browse latest Browse all 5060

Trending Articles