- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- awk difference (RE) between HP-UX and Linux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2012 12:34 AM
01-19-2012 12:34 AM
Re: awk difference (RE) between HP-UX and Linux
Hello Dennis ,
thank you very much about your useful and helpful informations
>Do you have an example where it fails?
>but the options of ERE of gawk isn't possible to use for awk HPUX like r{n,m} with possix
when you try to use HPUX awk and LINUX awk / HPUX gawk, then you get syntax errors !
> No, this is a bogus ERE, in that it most likely won't do anything useful.
so it works, but i have no guarantee that this ERE will work in the future , right ?
>You can see this if you change awk to add:
>BEGIN { print "ERE:", (+DB_TOKEN) }
i tested it , thank.
my last question ( i spoke with other colleagues ) :
is better to use "perl" with "ERE" for different plattforms ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2012 12:44 PM
01-19-2012 12:44 PM
Re: awk difference (RE) between HP-UX and Linux
>when you try to use HP-UX awk and LINUX awk / HP-UX gawk, then you get syntax errors!
Do you have an example of that?
>so it works, but I have no guarantee that this ERE will work in the future, right?
No, it doesn't really work. Your ERE is bogus. A leading "+" doesn't make sense for a ERE.
>is better to use "perl" with "ERE" for different platforms?
In this case, if you have valid ERE, it should work in both cases.
But you may have a valid point, perl may be more portable and doesn't have the HP-UX awk limitations.
And matching has more choices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2012 04:37 AM
01-20-2012 04:37 AM
Re: awk difference (RE) between HP-UX and Linux
you will get examples next week
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 06:15 AM
02-13-2012 06:15 AM
Re: awk difference (RE) between HP-UX and Linux
hello,
here my solution of perl ( instead of awk ) :
DB_TOKEN=DB_DEF perl -lan -F"#" -e'if($F[0] =~ /^\S+$ENV{DB_TOKEN}/) {print "$F[1] $F[4]"}' file
or
perl -F"#" -lane '$s=shift @F;if($s=~ /^\S+'$DB_TOKEN'/) {print "@F"}' file
with a little help of perl examples
regards
- Tags:
- Perl
- « Previous
-
- 1
- 2
- Next »