≡ Menu


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

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?
[click to continue…]

Sysadmin because even developers need heroes!!!

Truncate: UNIX Binary Log File

How do I truncate a UNIX binary log file using command line options?
[click to continue…]

Linux/UNIX: Move File Starting With A Dash

In Unix or Linux operating systems, how do I move file(s) starting with a dash (e.g., /home/you/–filename.txt or /home/you/-filename.txt)?
[click to continue…]

Apple Mac OS X Open And View .chm File

I know how to open .chm files under Linux, but how do you open and view .CHM files under Apple Mac OS X?
[click to continue…]

sed Delete / Remove ^M Carriage Return (Line Feed / CRLF) on Linux or Unix

How can I remove the ^M or ^M (carriage Return / line feed ) from text file using sed under UNIX or Linux operating systems?
[click to continue…]

Use BASH nullglob To Verify *.c Files Exists or Not In a Directory

Can you explain me usage of nullglob variable under BASH? How do I check for any *.c files in any directory?
[click to continue…]

Solaris UNIX Case-Insensitive Find File Search

I‘d like to match all filename like foo.c, FOO.C, fOO.c, Foo.C and so on using find command under UNIX. How do I do a case-insensitive find search under Sun Solaris / OpenSolaris UNIX systems?
[click to continue…]

Find command: Exclude or Ignore Files (e.g. Ignore All Hidden .dot Files )

How do I ignore all hidden .dot files while searching for files using the find command? How do I ignore or exclude certain files while running Linux or UNIX find command?
[click to continue…]

x86_64 Linux Error: gnu/stub-32.h Missing Error and Solution

I‘m getting the following error while compiling application under CentOS / RHEL / Fedora Linux 64 bit edition:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h:

No such file or directory

How do I fix this error and compile my applications using gcc under RHEL / Fedora / CentOS Linux 64bit system?
[click to continue…]

Bash Shell: Replace a String With Another String In All Files Using sed and Perl -pie Options

How do I replace a string with another string in all files? For example, ~/foo directory has 100s of text file and I’d like to find out xyz string and replace with abc. I’d like to use sed or any other tool to replace all occurrence of the word.
[click to continue…]