October 30, 2012

Korn Shell: no basic pattern matching operators !!

Posted in Utility at 2:24 pm by alessiodini

Today i was playing with HP-UX. I would try to write a simple ksh script ( trying korn shell syntax ) but i had a big problems with regular expressions. I tried to use the classic ‘^’ or ‘$’ operator , without success. After some time i looked on the web ( i tought ksh needed some different syntax ) but i found this:

“A few egrep and awk regexp operators do not have equivalents in the Korn shell. These include:

The beginning- and end-of-line operators ^ and $.

The beginning- and end-of-word operators \.

Repeat factors like \{N \} and \{M , N \}.

The first two pairs are hardly necessary, since the Korn shell doesn’t normally operate on text files and does parse strings into words itself.

o_O really!?
bad notice ;(

Advertisements

1 Comment »

  1. youtube views software said,

    That is a good tip particularly to those new to the blogosphere.

    Short but very accurate information… Thank you for sharing this one.
    A must read article!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: