Thanks vgersh99 for the code
But in my OS nawk is not supporting But if i go for awk this command work fine for me in SHELL But when i keep this thing in a shell script it won't works. Getting error unable to read passwd.txt file.
Thanks
Manabhanjan
Well.... my crystal ball says that your script cannot find or read the passwd.txt file.
I'd suggest to start debugging the script.
Good luck.
Hi all,
can you please help me in this one..
i have a many scripts in a directory & i get many requests to change the code of a particular script.
for example file abc.txt contains
#!/bin/bash
mumbai 102403445
chennai 123980123
delhi 3456268468
kolkata 465376832
#kolkat 462945959
... (3 Replies)
Hi All,
I want to edit a file using shell script..For ex...a file called /etc/passwd..here I am searching for "ftp" if it is there just change it to "tftp" without using any temporary file. (3 Replies)
Dear unix gurus,
I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this:
adam peter
blah blah blah
blah blah blah
car
01 30 200
02 31 400
03 57 121
.. .. ..
.. .. ..
n y... (8 Replies)
Col1 Col2 Col3 Col4
12 Completed 08 0830
12 In Progress 09 0829
11 For F U 07 0828
Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
I have the follwoing file:
This looks to be : seperated.
For the first field i want only the file name without ".txt" and also i want to remove "+" sign if the second field starts with "+" sign.
Input file:
Output file:
Appreciate your help (9 Replies)
What is an efficient way to remove all lines from the input file which contain a file name?
inputfile:
=======================
# comment
# comment
# comment
5 8 10 /tmp
5 8 10 /var/run
5 8 10 /etc/vfstab
5 8 9 /var/tmp
5 8 10 /var/adm/messages... (7 Replies)
hey i want to over write the fourth field of a ':' delimited file by first finding the required row by using grep.
i have done the following
cat file | grep no. | awk -F ':' { $4=count; print $1:$2:$3:$4;}
the correct values are being printed but nothin is bein added to the file..please... (5 Replies)
Hi,
I lack the utter fundamentals on how to craft an awk script.
I have hundreds of text files that were mangled by .doc format so all the lines are broken up so I need to join all of the lines of text into a single line. Normally I use vim command "ggVGJ" to join all lines but with so many... (3 Replies)
Hey guys,
I'm trying to learn a bit of awk/sed and I'm using different sites to learn it from, and i think I'm starting to get confused (doesn't take much!).
Anyway, say I have a csv file which has something along the lines of the following in it:"test","127.0.0.1","startup... (6 Replies)
Hello,
Similar question to my previous posts. I am sorry for the trouble...
Just checked my old threads but I can not implement any solution into this case..
My aim is to grab each line in fileA, check it in fileB and merge with fileC (tab separated) in corresponding line as given below:
FileA:... (2 Replies)
Discussion started by: baris35
2 Replies
LEARN ABOUT BSD
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.10 13 Apr 1994 ucblinks(1B)