You might try something like:
which with your sample data produces the output:
which matches what you said you wanted except for the 1st and last lines of the output. If you don' want extraneous <space> characters in the first line of your output, don't include them in both of your input files. And, if you don't want an empty field in the last line in your output, don't include an empty field in the last line of both of your input files.
As always, if you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk.
This User Gave Thanks to Don Cragun For This Post:
Hello,
I'm spendind hours trying to figure out how a script could remove files and folders older than 30days in a given volume (/dataVolumes/Booba.1.0).
Within this volume, all users have their personal folder that starts with "RC-..", so the script should skip them for deletion.
I will... (4 Replies)
Hello everyone,
My OS is AIX 5.2
I would like some help in getting command syntax that does the following:
1. Searches simultaneously several directories downward;
2. Checks every subdirectory in each directory (and so on...) for file names that contain certain characters such as “~”, start... (0 Replies)
Hi all,
i would like to create a script that move and rename files from all the subdirectories of a given directory to others subdirectories of the same directory based on "matching" criteria in the "from" and "to" parameters.
Example:
Begin script
from /home/test/1_T_2008* move to... (3 Replies)
Hi All,
I am creting archive script in which i need to split the source file's to different target folder's based on the input file name first character.
Input1.txt -- will contains file names that are needs to be Archive.
Input1.txt
A1213355
B2255666
C2254555
A6655444
C5566445
... (2 Replies)
I have a file.....
xxx 2345 455
abc 345 555
cdf 456 777
fff 555 888
Now my requirement is, Say if, i want to select only those records prior to the record fff 555 888...
how do i go about doing this in unix....
The fff would be hardcoded as it wud be fixed and everytime when i... (7 Replies)
I have a requirement where in i need to select records right below the search criteria
qwertykeyboard white
10 20 30
30 40 50
60 70 80
qwertykeyboard black
40 50 60
70 90 100
qwertykeyboard and white are headers separated by a tab.
when i execute my script..i would be searching... (4 Replies)
i have a directory which consist of multiple files out of which there are some files that has -e in their name.
I want to write a script that will change all those file-name to -l
example there are some files with name :
file1-e.wav
file2-e.wav
file3-english-e.wav
file-4-e.wav
... (3 Replies)
Hi!
I need to merge two files when col1 (x:x:x) matching and adds second column from file1.txt.
# cat 1.txt
aaa;a12
bbb;b13
ccc;c33
ddd;d55
eee;e11
# cat 2.txt
bbb;b55;34444;d55
aaa;a15;35666;a44
I try with this awk and I get succesfully first column from 1.txt:
# awk -F";"... (2 Replies)
Hi,
Please excuse for often requesting queries and making R&D, I am trying to work out a possibility where i have two files field separated by pipe and another file containing only one field where there is no matching columns, Could you please advise how to merge two files.
$more... (3 Replies)
I have one script as below:
#!/bin/ksh
Outputfile1="/home/OutputFile1.xls"
Outputfile2="/home/OutputFile2.xls"
InputFile1="/home/InputFile1.sql"
InputFile2="/home/InputFile2.sql"
echo "Select hobby, class, subject, sports, rollNumber from Student_Table" >> InputFile1
echo "Select rollNumber... (3 Replies)
Discussion started by: Sharma331
3 Replies
LEARN ABOUT OPENSOLARIS
getdgrp
getdgrp(1M) System Administration Commands getdgrp(1M)NAME
getdgrp - lists device groups which contain devices that match criteria
SYNOPSIS
/usr/sbin/getdgrp [-ael] [criteria]... [dgroup]...
DESCRIPTION
getdgrp generates a list of device groups that contain devices matching the given criteria. The criteria is given in the form of expres-
sions.
OPTIONS
The following options are supported:
-a Specifies that a device must match all criteria to be included in the list generated by this command. The option has no effect if no
criteria are defined.
-e Specifies that the list of device groups on the command line should be excluded from the list generated by this command. Without the
-e option the named device groups are included in the generated list. The flag has no effect if no devices are defined.
-l Specifies that all device groups (subject to the -e option and the dgroup list) should be listed even if they contain no valid
device members. This option has no affect if criteria is specified on the command line.
OPERANDS
The following operands are supported:
criteria Defines criteria that a device must match before a device group to which it belongs can be included in the generated list.
Specify criteria as an expression or a list of expressions which a device must meet for its group to be included in the list
generated by getdgrp. If no criteria are given, all device groups are included in the list.
Devices must satisfy at least one of the criteria in the list. However, the -a option can be used to define that a "logical
and" operation should be performed. Then, only those groups containing devices which match all of the criteria in a list will
be included.
There are four possible expressions types which the criteria specified in the criteria argument may follow:
attribute=value Selects all device groups with a member whose attribute attribute is defined and is equal to value.
attribute!=value Selects all device groups with a member whose attribute attribute is defined and does not equal value.
attribute:* Selects all device groups with a member which has the attribute attribute defined.
attribute!:* Selects all device groups with a member which does not have the attribute attribute defined.
See putdev(1M) for a complete listing and description of available attributes.
dgroup Defines a set of device groups which should be included in or excluded from the generated list. Device groups that are defined
and which contain devices matching the criteria are included.
If the -e option is used, this list defines a set of device groups to be excluded. When the -e option is used and criteria
is also defined, the generated list will include device groups containing devices which match the criteria and are not in the
command line list.
EXIT STATUS
The following exit values are returned:
0 Successful completion of the task.
1 Command syntax was incorrect, invalid option was used, or an internal error occurred.
2 Device table or device group table could not be opened for reading.
FILES
/etc/device.tab
/etc/dgroup.tab
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO devattr(1M), getdev(1M), putdev(1M), putdgrp(1M), attributes(5)SunOS 5.11 5 Jul 1990 getdgrp(1M)