04-10-2011
awk - setting fs to equal any single character
Hi
Does anyone know how to set any character as the field separator with awk/nawk on a solaris 10 box. I have tried using /./ regex but this doesnt work either and im out of ideas.
thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Relatively new poster but long time reader. I tried searching all threads for similar situations with mine but I've had no luck with some of the solutions.
I have a script (script.ksh) that is getting information from an Oracle DB and spooling it into a text file (log.txt). I would then like... (1 Reply)
Discussion started by: Crios121
1 Replies
2. Shell Programming and Scripting
normally when i type:
condor_q | tail -1
command line returns:
0 jobs; 0 idle, 0 running, 0 held
I want use the number in front of 'running' in a series of equality tests to submit more jobs when my queue gets low. Someone showed me how to do it a few days ago by setting an array equal to... (4 Replies)
Discussion started by: pattywac
4 Replies
3. Shell Programming and Scripting
Hi,
I have a file 'imei_01.txt' having the following contents:
$ cat imei_01.txt
a123456
bbr22135
yet223
where I want to check whether the expression 'first single alphabet followed by 6 digits' is present in the file (here it is the first record 'a123456')
I am using the following... (5 Replies)
Discussion started by: royalibrahim
5 Replies
4. Shell Programming and Scripting
I already have accomplished this task using sed and arrays, but since I get the variable using awk, I figured I'd ask this question and maybe I can get a cleaner solution using strictly awk.. I just can't quite grasp it in awk.
Story: I'm automating the (re)configuration of network interfaces,... (3 Replies)
Discussion started by: System Shock
3 Replies
5. Shell Programming and Scripting
How do you print out a single quote character in AWK? Using the escape character does not seem to work.
{printf "%1$s %2$s%3$s%2$s\n" , "INCLUDE", " \' ", "THIS" }
does not work. Any suggestions? (6 Replies)
Discussion started by: cold_Que
6 Replies
6. Shell Programming and Scripting
Hi all,
Greetings,
I have the following scenario, The contents of main file are like :
Unix|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And i need the output in the following form:
Unix=forum=is=the=best
so=be=on=it
... (3 Replies)
Discussion started by: dipanchandra
3 Replies
7. Shell Programming and Scripting
(2 Replies)
Discussion started by: snoman1
2 Replies
8. Shell Programming and Scripting
I have a data file d0 that looks like this:
$cat d0
server1 running -n-cv- 8G 3.1% 1435d 15h
server2 running -n---- 8G 39% 660d 22h
server3 running -n--v- 8G 2.5% 1173d 6h
server4 running -n---- 8G 1.1% 1048d 20h... (2 Replies)
Discussion started by: jake0391S
2 Replies
9. UNIX for Dummies Questions & Answers
I have a file that looks like this:
14985 DPN verb PPa to spend.
12886 DPNDJN bay tree.
15686 DQ verb to observe
15656 KC ... (7 Replies)
Discussion started by: jvoot
7 Replies
10. Shell Programming and Scripting
I have a csv dataset like this :
C,rs18768
G,rs13785
GA,rs1065
G,rs1801279
T,rs9274407
A,rs730012
I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same)
CC,rs18768
GG,rs13785
GA,rs1065
GG,rs1801279
TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
LEARN ABOUT OPENSOLARIS
ucblinks
ucblinks(1B) SunOS/BSD Compatibility Package Commands ucblinks(1B)
NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices
SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir]
DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi-
ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry.
ucblinks does not remove unneeded compatibility links; these must be removed by hand.
ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created,
since the reconfiguration may have resulted in more compatibility names being needed.
In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk
for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS
5.4 default operation can be found in /usr/ucblib/ucblinks.awk.
OPTIONS
-e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements.
-r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /.
FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO
devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5)
SunOS 5.11 13 Apr 1994 ucblinks(1B)