This is my input file ..
[root@localhost scripts]# cat ip6hdr.txt | xargs -n4
6000 0000 005C 3320
2001 0000 0000 0000
0000 0000 0000 0100
2001 0000 0000 0000
0000 0000 0000 0200
I want to change the last two digits of first line of the file i.e. 20 to 00.
I tried this..
cat ip6hdr.txt | xargs -n4 | sed '1,1s/\([0-9]*\) \([0-9]*\) \([0-9]*\) \([0-9][0-9]\)\([0-9][0-9]\).*/\1 \2 \3 \400 /'
Previously it was working fine on ubuntu now not working on fedora in a bash script
I have no reason why it works on one system and not on other one ..
[root@localhost scripts]# sed --version
GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
if possible suggest me some alternative ..
Why complicate things?