My script depends upon $1 to take certain actions:
However, sometime there will leading while space which will result into:
How do I trim leading white space from one of my input variables?
ow can I remove the ^M or ^M (carriage Return / line feed ) from text file using sed under UNIX or Linux operating systems?
How do I replace newline (\n) with sed under UNIX / Linux operating systems?
am a new Unix system user with a bash as a default shell. I can append text to a file using >> operator but how do I prepend a text to a file? I want the opposite operation of >>? How can I prepend some data to a text file?
ost Linux and UNIX-like system configuration files are documented using comments, but some time I just need to see line of configuration text in a config file. How can I view just the uncommented configuration file directives from squid.conf or httpd.conf file? How can I strip out comments and blank lines on a Linux or Unix-like systems?
Q. How do I find the text between the strings FOO and BAR inclusive using sed command line option?
Continue reading “Sed Find and Display Text Between Two Strings or Words”
Q. How do I perform a case-insensitive search using sed under UNIX / Linux? I’d like to match all combination of word – foo, FOO, FoO and so on while replacing or performing other operations.