LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 10: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, 10:45 AM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,550

Rep: Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898
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, 09:30 PM   #18
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:58 PM
[SOLVED] print first 2 characters + second column udiubu Linux - Newbie 2 05-22-2012 01: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 05:50 AM
Help needed - How to check quality of a specific column in a tab-delimited file? Jason7449 Linux - Newbie 3 03-08-2010 10:36 AM
nawk question - addition of a column dazdaz Programming 1 02-19-2008 12:47 PM

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

All times are GMT -5. The time now is 09:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration