The following should work the same as your six line script reading the data from each input file once (instead of four times), call awk once (instead of four times), and not calling paste or rm at all:
As with your script, surprising things may happen if file1 and file2 don't contain the same number of lines.
------------------
PS for the 2nd part of your original posting (which has been lost in all of your edits), two portable ways to add:
to the end of a file without using cat include:
and
Note that printf is a built-in in ksh and echo is a built-in in most shells. Some versions of echo always recognize backslash escape sequences, some versions of echo never recognize backslash escape sequences, and some versions of echo violate POSIX standard and Single UNIX Specification requirements by accepting an option that determines whether or not backslash escape sequences are recognized. The uses of echo shown above should do what you want here with any version of echo.
Last edited by Don Cragun; 11-23-2012 at 02:57 AM..
Hi Gurus,
In my file I have an amount field from position 74 to 87, which contains values starting with '+' as well as '-'. I want to add all positive values in a varible called "CREDIT" and all negative values in a variable "DEBIT". I know, we can use grep to identify values with positive and... (4 Replies)
In my college dorm, there is a file sharing network in the entire building. Problem is, there is only a manual for windows with the settings on how to connect... :mad:
They say that you have to give the following command in cmd in windows:
route add 172.16.71.0 mask 255.255.255.0... (2 Replies)
Hi Solaris users - I have an Ultra10 SPARC machine, with IIe processor. To prepare for the Solaris10 admin exam PartII I need to set up the metadb/mirroring in my machine, but do not know how to do this properly.
I need this to practice the mirroring tasks.
If anyone could help it would be... (3 Replies)
Hi, I need to add a column of unique string to individual csv file.
my individual csv file looks like this and each file has variable row length:
178.52,39.4,train,0.003355544375334351,39.15752753933254,0.4895933968953914... (7 Replies)
Hello,
I was wondering if anyone knows a faster way to search and compare strings and dates from 2 files?
I'm currently using "for loop" but seems sluggish as i have to cycle through 10 directories with 10 files each containing thousands of lines.
Given:
-10 directories
-10 files... (4 Replies)
Hi All,
I have two files having oracle query result. I want to merge to files line by line and also with column
File1
23577|SYNC TYPE
23578|Order Number|ConnectionState
23585|Service State|Service NameFile2
23577|AR Alarm Sync
23578|A5499|9
23585|7|test_nov7Result... (18 Replies)
HI Guys,
I have below input.
Output Base on Below Condition.
1> if forth column is empty and next coming line have same name with \es then add that column name on all rows
2>rest of all are es:vsDataEUtranCellFDD
Input:-
CCL01736 CCL01736_7A_1 es:vsDataEUtranCellFDD ... (3 Replies)
Greetings Experts,
I need to handle the views created over monthly retention tables
for which every new table in YYYYMMDD format, there is
equivalent view created and the older table which might be
dropped, the view over it has to be re-created over a dummy
table so that it doesn't fail.... (2 Replies)
Hi All,
I have a file with only one column of data (without delimiter). For Ex:
cat temp.txt
22055
21088
93840
30990
50990
50950
I want to insert an additional column with current date as value. So, i have used below command but didn't get the result as excepted. Could onyone over... (5 Replies)
Discussion started by: Suresh
5 Replies
LEARN ABOUT DEBIAN
list-desktop-profiles
LIST-DESKTOP-PROFILES(1) General Commands Manual LIST-DESKTOP-PROFILES(1)NAME
list-desktop-profiles - list known profiles that meet given criteria
SYNOPSIS
list-desktop-profiles [OPTION]
DESCRIPTION
As the number of .listing files holding metadata grows, trying to find out which profiles are present/meet certain criteria becomes
increasingly unpleasant. This script remedies that allowing you to just list your criteria, and outputting all profiles meeting those cri-
teria.
By default it will just output the lines from the .listing files for each (matching) profile, but you can specifying a formatstring to
fancy up the output.
OPTIONS -n <regexp>, --name <regexp>
Limit shown profiles to those for which the name (1st) field of the profile description needs matches the given regular expression.
-k <regexp>, --kind <regexp>
Limit shown profiles to those for which the kind (2nd) field of the profile description needs matches the given regular expression.
-l <regexp>, --location <regexp>
Limit shown profiles to those for which the location (3th) field of the profile description needs matches the given regular expres-
sion.
-p <comparison>, --precedence <comparison>
Limit shown profiles to those for which the precedence (4th) field of the profile description succeeds the given comparison. In the
comparison you can Use 'gt' for 'greater then', 'lt' for 'less then', 'ge' for 'greater then or equal to', 'le' for 'less then or
equal to', 'eq' for 'equal to', and 'ne' for 'not equal to'. (NOTE: empty precedence-field, is lowest possible precedence)
-r <regexp>, --requirement <regexp>
Limit shown profiles to those for which the requirements (5th) field of the profile description needs matches the given regular
expression.
-c <regexp>, --comment <regexp>, --description <regexp>
Limit shown profiles to those for which the comment (6th) field of the profile description needs matches the given regular expres-
sion.
-u <username>, --user <username>
Limit shown profiles to those for which the given user meets the requirements. (NOTE: doesn't always give correct results! Results
might be wrong when using shell command requirements that depend on the users environment. Or when 'group $USER' gives a different
result as 'group' executed as $USER, which can happen when adding groups through pam_group).
-d <dir>, --directory <dir>
Also use .listing files found in the given directory. This option can be used multiple times to add more then 1 additional directory
-e <formatstring>, --entry-format <formatstring>
Show profile information according to the specified format spring (instead of just echoing the profile-line). The format string may
use the following variables: NAME, LOCATION, PRECEDENCE, REQUIREMENTS, KIND, DESCRIPTION, FILE; the first 6 of these refer to the
corresponding field, the last refers to the .listing file the profile is in. (e.g. '$FILE_$NAME - $DESCRIPTION'). Any characters
that are interpreted specially by the shell should be escaped.
-s <fieldname>|<fieldnumber>, --sort-key <fieldname>|fieldnumber
Sort output on the requested field (fieldname is one of name, kind, location, precedence, requirements, or description; fieldnumbers
run from 1-6).
EXAMPLES
list-desktop-profiles -k KDE -s precedence -u user1
List all kde-profiles that will be activated for user1 in order of precedence.
list-desktop-profiles -k 'KDE|GCONF'
List all kde and gnome profiles.
list-desktop-profiles -p 'gt 50'
List all profiles with a precedence value greater then 50.
ENVIRONMENT
NAME_FILTER, LOCATION_FILTER, PRECEDENCE_FILTER, REQUIREMENT_FILTER, KIND_FILTER, DESCRIPTION_FILTER
Can be used to specify the default regular expressions and comparisons. Default to empty.
OUR_USER
Set the user for which the requirements need to be met. Defaults to unset.
EXTRA_LISTINGS
Can be used to specify a (space separated) list of extra .listing files to include. Defaults to empty
FORMAT
Can be used to specify the default format string. By default it will output the profile-line from the .listing file.
SORT_KEY
Can be used to specify the default sort-key (= field number). Defaults to 1
FILES
/etc/desktop-profiles/*.listing - Files containing the metadata about installed profiles
/etc/default/desktop-profiles - File containing default settings for this script (by way of the environment variables above)
BUGS
The '-u <username>' is not guaranteed to work correctly for shell command requirements. Particulary this will give incorrect results if the
shell command depends on some state of the user environment.
AUTHOR
This manual page was written by Bart Cornelis <cobaco@skolelinux.no>.
SEE ALSO desktop-profiles(7), update-profile-cache(1), profiles-manager(1)desktop-profiles November 11, 2004 LIST-DESKTOP-PROFILES(1)