awk: warning: escape sequence '\<' treated as plain '>'

Posted on in Categories last updated September 29, 2012

I‘m trying to match words using GNU awk command and getting the following error:

echo 'foo bar this that blah' | awk '{gsub("\<regex-word\>", "NEW-WORD");print}'

But getting the following warning on screen and it is not working:
awk: warning: escape sequence `\<' treated as plain `<' awk: warning: escape sequence `\>' treated as plain `>'

How do I fix this problem under Unix like operating systems?

Bash History: Correct / Repeat The Last Command With a Substitution

Posted on in Categories , , last updated February 23, 2016

I often type the wrong command as follows under Linux bash shell:

rsync -av dir1 [email protected]:/path/to/dir1

OR

cp -av file1*.txt file2*.txt /path/to/dest

I need to correct those command as follows:

rsync -av dir5 [email protected]:/path/to/dir1
cp -av delta1*.txt delta2*.txt /path/to/dest

How do I replace dir1 with dir5 or file with delta and repeat the last command under bash shell?