sed -n '/[0-9]\{10\}E[1-2]/p' $filename | sort >> $filename.sorted
Could somebody please give me a breakdown of what exactly each part of this sed statement does, I have inherited a production script, and know that basically it sorts a file that looks like this
0304053456e17347983740284738495
6354053454e27347983770267638494
2304053456e17347983740284738495
2304053456e27347983740284738495
Notice the 31st/32nd character (including the 20 spaces) there is an e1 or e2) as far as I can determine, its taking all the e1's, putting them into a file called $filename.Sorted ($filename variable is created earlier in the script) Then taking all the e2's and appending them to the end of that file. .In the above example the destination file looks like this
0304053456e17347983740284738495
2304053456e17347983740284738495
6354053454e27347983770267638494
2304053456e27347983740284738495
Note the e1's are at the top and all e2,s are at the bottom. Im specifically interested in the first portion "sed -n '/[0-9]\{10\}e[1-2]/p' "
Any help on this would be greatly appreciated
Could somebody please give me a breakdown of what exactly each part of this sed statement does, I have inherited a production script, and know that basically it sorts a file that looks like this
0304053456e17347983740284738495
6354053454e27347983770267638494
2304053456e17347983740284738495
2304053456e27347983740284738495
Notice the 31st/32nd character (including the 20 spaces) there is an e1 or e2) as far as I can determine, its taking all the e1's, putting them into a file called $filename.Sorted ($filename variable is created earlier in the script) Then taking all the e2's and appending them to the end of that file. .In the above example the destination file looks like this
0304053456e17347983740284738495
2304053456e17347983740284738495
6354053454e27347983770267638494
2304053456e27347983740284738495
Note the e1's are at the top and all e2,s are at the bottom. Im specifically interested in the first portion "sed -n '/[0-9]\{10\}e[1-2]/p' "
Any help on this would be greatly appreciated