N00b's bash, sed, or awk question
I'm trying to compare two huge directory trees that start like this:
/backup/volume/20070718/tree/... and /backup/volume/20070719/tree/... diff doesn't work for me because it sees that difference in the dates, and considers every line different. How can I trim-off the first 28 characters of each line of a text file? I had considered using sed to substitute "/backup/volume/20070718/tree/" with "/", but I got messed-up with the / characters. |
Code:
sed -e 's/^............................//' input_file > output_file Hope this helps. |
No, that's perfect for me! I am certain that I have no lines shorter than 28 characters. I'm going to run back to my server's shell and give it a try right now....
It works just right. |
Quote:
Code:
sed 's"/backup/volume/20070719/tree/""' |
Code:
sed 's/^.\{,28\}//' |
For some versions of sed, this will give you a syntax error:
Code:
sed 's/^.\{,28\}//' Code:
sed 's/^.\{0,28\}//' |
All times are GMT -5. The time now is 07:31 PM. |