Do you happen to know what the "10" is referring to???
Try the following and it will show you which characters you are working with: Code:
echo "(hd0,0)" | od -A n -t c |
What is it good for? I see characters in output
echo <string> Edit: Now I am going to write a script save the blocks. You know that I operate with block separately not with whole file. There for all items/blocks from array content I need to proceed through for loop and then do a search of bock and replace. Is it possible to do such search in sed? I now that sed has problems with multiline searches. It's like to search something like this: line 1 title \n line 2 ... \n line 3 ... \n and replace it... I would better prefer to identify hole block so ... if in file exists more same titles but with different uuid, it will not be overwritten because of identical titles, but he would reconize that the next line is different from the pattern.... |
Quote:
This therefore makes your test useless as it will NEVER be wrong. Yes you can do multiline edits in sed but you will need to be careful about how you go about it. Personally I think you need to step back and rethink what you are trying to do. Also, as identified on several occasions, you need to test a lot more of what you are trying to do before going ahead. Currently you are trying to change fields which may or may not actually work/be allowed. Most of all you need to try and build your script a line at a time by trialling what you want to do on the command line first and see what the results are. This process would save a lot of the stoppages you have been running into. |
Quote:
Quote:
Edit: Quote:
|
Quote:
Quote:
As with my previous post, really the best way to see what will work is at the command line on a test scenario. |
I found something unsolved yet in the script. At the beginning needed to be a code that decides about way of conversion. It means for all blocks I need to convert from uuid to hd or from hd to uuid. This thing I forgot. Now I created this code:
Code:
block_new="title Sata Mandriva Edit: One more awk. This code should escaped characters of class [/+()[]] Code:
block_new=" / + ( ) [ ] " |
For your first problem set a variable and once it is a value do not print anymore.
Second problem: 1. /.*/ - this is a complete waste as once again, refer to previous posts, it is ALWAYS true so not required 2. What do you expect from echo $p? |
Edit 1:
Quote:
Code:
awk '/(UUID=)|(\(hd)/' Edit 2: Quote:
Code:
p=$( echo $block_new | awk '{ x=gensub( /([/+()[]])/ ,"//\\1","g"); print x}') |
All times are GMT -5. The time now is 01:38 PM. |