Re:Learn to Process Text in Linux Using Grep, Sed, and Awk
by 1vuio0pswjnm7 on Saturday January 07, 2023 @01:25AM
(#34285739)
If provide a text-processing problem I will try to provide a solution.
[ Parent
| on HN ]
Re:Learn to Process Text in Linux Using Grep, Sed, and Awk
by 1vuio0pswjnm7 on Tuesday January 10, 2023 @01:20AM
(#34321202)
Here is another variation that does not used "sed -i". It uses a favourite hex editor called ired.
test ! -h $1||exec echo $0: error: symlink
case $# in :)
;;1) x=$(sed -n '$=' $1)
test $x -gt 1||exec echo usage: $0 dst src
od -tx1 -An|sed 's/^/w /'|ired -n $1 /dev/stdin
;;2) printf '0r '$2'\nwq\n'|ed -s $1
esac