LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2013, 09:11 PM   #16
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286

Quote:
Originally Posted by grail View Post
When you say your system, is that solaris? I understand it has a different variant of awk, whereas most linux distros are using gawk or similar.
Right... I tried it on Solaris. But I used the version installed as /usr/xpg4/bin/awk, that is, nawk. Don't know why it didn't give the result.
 
Old 04-04-2013, 09:45 AM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Yeah both namk and mawk left me cold for the sorts of things they have chosen to not support. In your case I would probably ditch the if all together as it is not really testing anything and just perform
the assignment and the print:
Code:
awk '{$5="chr"$5;print}' file
Should hopefully work
 
Old 04-04-2013, 08:30 PM   #18
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Have you got/can you install sfw (sun freeware pkg)? That has the GNU toolset
Usually goes in /opt iirc.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] column issue with accented characters... masavini Programming 2 10-30-2012 12:58 PM
[SOLVED] print first 2 characters + second column udiubu Linux - Newbie 2 05-22-2012 12:48 PM
compare second column of a file then print the first column of it in a ne fil if true java_girl Linux - Newbie 2 03-16-2012 04:50 AM
Help needed - How to check quality of a specific column in a tab-delimited file? Jason7449 Linux - Newbie 3 03-08-2010 09:36 AM
nawk question - addition of a column dazdaz Programming 1 02-19-2008 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration