04-05-2010
Shell Script to Create non-duplicate lists from two lists
File_A contains Strings:
a
b
c
d
File_B contains Strings:
a
c
z
Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below.
Resultant files:
File_New_A contains String:
a
c
File_New_B contains String:
z
Thank you in advance for your help.
mlv_99
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Can anyone provide me any checklists or a list of steps I should follow before executing my scripts.
Could also tell me if there are any other standards to be followed while shell programming like naming conventions for variables etc.
Your help would be much appreciated.
Regards,... (2 Replies)
Discussion started by: srikanth_ksv
2 Replies
2. Shell Programming and Scripting
Below is a description of what im trying to achieve:
Write a shell script to concatenate lists together, and output the resulting list. Do not include any argument that is a sub-list of the entire list. (The script will clean the list of any redundant items.) You must preserve the original order... (1 Reply)
Discussion started by: rfourn
1 Replies
3. Shell Programming and Scripting
Hi, I need a script that will:
1. Go through about 20 different folders, each containing about 20 1d files. The 1d files go something like this:
22.253 37.707 78.117 112.374 127.944 156.067 180.956 233.785 249.256 ... (1 Reply)
Discussion started by: ac130pilot
1 Replies
4. Shell Programming and Scripting
Hello Unix Gurus,
I have:
A list of parameters that repeat (in .txt file)
Example: params.txt
Series: XYZ
Manufacturer: ...
Software Version: ...
Year made: ...
Series Series: XYZ
Manufacturer: ...
Software Version: ...
Year made: ...
Series Series: ABC
Manufacturer: ...
... (7 Replies)
Discussion started by: lapiduslost
7 Replies
5. Shell Programming and Scripting
Hi,
I do little bash scripting so sorry for my ignorance.
How do I compare if the two variable not match and if they do not match run a command.
I was thinking a for loop but then I need another for loop for the 2nd list and I do not think that would work as in the real world there could... (2 Replies)
Discussion started by: GermanJulian
2 Replies
6. Shell Programming and Scripting
Hello, I'm trying to write a script which is listing files based on different preferences, like filetype or permissions. All is fine, except for one: I want to list files in /home which has a different owner than the home directory it is in.
Here is an example:
/home/UserA is the directory, and... (10 Replies)
Discussion started by: Zwiebi
10 Replies
7. Shell Programming and Scripting
I expert,
I may cross post something similar but I dirtyed my quesion somehow to be clear in the thread
#cat file1
88dee gcc: Grok for callconvention-hard to enable hard float
a2ad2 eglibc: package mtrace separately
61487 python: bump PR of packages after update of distutils.bbclass... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
8. Shell Programming and Scripting
I have a file which has connections given as:
A B 0.1
B C 5.8
C B 5.8
E F 0.67
B A 0.1
A B and B A are same, so I want to remove one of them. Same with BC and CB.
Desired output:
A B 0.1
B C 5.8
E F 0.67 (2 Replies)
Discussion started by: Sanchari
2 Replies
9. Shell Programming and Scripting
help me (1 Reply)
Discussion started by: sonu pandey
1 Replies
10. UNIX for Beginners Questions & Answers
I have a script that sorts and processes unsorted files to newly created directories.
Its working great, but I am trying to understand the leanest method to get the script to create an additional file within each newly created directory that:
Contains a list of all files in the directory... (4 Replies)
Discussion started by: Braveheart
4 Replies
mkmsgs(1) User Commands mkmsgs(1)
NAME
mkmsgs - create message files for use by gettxt
SYNOPSIS
mkmsgs [-o] [-i locale] inputstrings msgfile
DESCRIPTION
The mkmsgs utility is used to create a file of text strings that can be accessed using the text retrieval tools (see gettxt(1), srchtxt(1),
exstr(1), and gettxt(3C)). It will take as input a file of text strings for a particular geographic locale (see setlocale(3C)) and create a
file of text strings in a format that can be retrieved by both gettxt(1) and gettxt(3C). By using the -i option, you can install the cre-
ated file under the /usr/lib/locale/locale/LC_MESSAGES directory (locale corresponds to the language in which the text strings are writ-
ten).
inputstrings is the name of the file that contains the original text strings. msgfile is the name of the output file where mkmsgs writes
the strings in a format that is readable by gettxt(1) and gettxt(3C). The name of msgfile can be up to 14 characters in length, but may not
contain either (null) or the ASCII code for / (slash) or : (colon).
The input file contains a set of text strings for the particular geographic locale. Text strings are separated by a newline character. Non-
graphic characters must be represented as alphabetic escape sequences. Messages are transformed and copied sequentially from inputstrings
to msgfile. To generate an empty message in msgfile, leave an empty line at the correct place in inputstrings.
Strings can be changed simply by editing the file inputstrings. New strings must be added only at the end of the file; then a new msgfile
file must be created and installed in the correct place. If this procedure is not followed, the retrieval function will retrieve the wrong
string and software compatibility will be broken.
OPTIONS
The following options are supported:
-o Overwrite msgfile, if it exists.
-i locale Install msgfile in the /usr/lib/locale/locale/LC_MESSAGES directory. Only someone who is super user or a member of group
bin can create or overwrite files in this directory. Directories under /usr/lib/locale will be created if they do not
exist.
EXAMPLES
Example 1: Using the mkmsgs command.
The following example shows an input message source file C.str:
File %s: cannot be opened
%s: Bad directory
.
.
.
write error
.
.
Example 2: Using Input Strings From C.str to Create Text Strings in a File
The following command uses the input strings from C.str to create text strings in the appropriate format in the file UX in the current
directory:
example% mkmsgs C.str UX
Example 3: Using Input Strings From FR.str to Create Text Strings in a File
The following command uses the input strings from FR.str to create text strings in the appropriate format in the file UX in the directory
/usr/lib/locale/fr/LC_MESSAGES:
example% mkmsgs -i fr FR.str UX
These text strings would be accessed if you had set the environment variable LC_MESSAGES=fr
and then invoked one of the text retrieval tools listed at the beginning of the DESCRIPTION section.
FILES
/usr/lib/locale/locale/LC_MESSAGES/*
message files created by mkmsgs
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWloc |
+-----------------------------+-----------------------------+
SEE ALSO
exstr(1), gettxt(1), srchtxt(1), gettxt(3C), setlocale(3C), attributes(5)
SunOS 5.10 26 Jul 1994 mkmsgs(1)