Sponsored Content
Top Forums Shell Programming and Scripting Concatenating 2 lines from 2 files having matching strings Post 302818505 by alister on Friday 7th of June 2013 03:34:50 PM
Old 06-07-2013
I don't think OFS is relevant since none of the solutions rebuild $0 or use a print statement with multiple args.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenating Strings

Is there any function to concatenate strings in shell script (2 Replies)
Discussion started by: radhika03
2 Replies

2. Shell Programming and Scripting

concatenating strings..

hey guys.. probably a simple question but i cant seem to find any info on it. i have a small array of strings, and i want to concatenate the contents of the array into one big string. any ideas on how i can do this? cheers. (2 Replies)
Discussion started by: jt_csv
2 Replies

3. Shell Programming and Scripting

Remove matching lines with list of strings

Hi, HP-UX gxxxxxxxc B.11.23 U ia64 3717505098 unlimited-user license I have a file with below pipe separated field values: xxx|xxx|abcd|xxx|xxx|xx xxx|xxx|abcd#123|xxx|xxx|xx xxx|xxx|abcd#345|xxx|xxx|xx xxx|xxx|pqrs|xxx|xxx|xx xxx|xxx|pqrs#123|xxx|xxx|xx The third field has values like... (6 Replies)
Discussion started by: Nanu_Manju
6 Replies

4. Shell Programming and Scripting

concatenating strings

I m new to shell scripting and what i want is take as an i/p from command line the name of the file and inside my script i should redirect the o/p of my few commands to this file concatenated with .txt for example if i give ./linux filename i should get the o/p in filename.txt i need to... (2 Replies)
Discussion started by: tulip
2 Replies

5. Shell Programming and Scripting

concatenating selected lines of multiple files

Hi, I would like a shell script that reads all files in a directory and concatenate them. It is not a simple concatenation. The first few lines of the files should not be included. The lines to be included are the lines from where 'START HERE' appears up to the end of the file. For example, I... (4 Replies)
Discussion started by: laiko
4 Replies

6. Shell Programming and Scripting

Concatenating lines of separate files using awk or sed

For example: File 1: abc def ghi jkl mno pqr File 2: stu vwx yza bcd efg hij klm nop qrs I want the reult to be: abc def ghistu vwx yza jkl mno pqrbcd efg hij klm nop qrs (4 Replies)
Discussion started by: tamahomekarasu
4 Replies

7. Shell Programming and Scripting

Problem in concatenating two Strings

Hi Friends, I'm new to shell scripting and trying to concatenate two Strings to create a filepath like string but I'm getting an unexpected result. here is my code for 'runToneUserLoad.sh': script_dir="$(dirname $0)" echo "Script Dir:$script_dir" dirtest1="/installedUtility"... (6 Replies)
Discussion started by: kuldeept
6 Replies

8. Shell Programming and Scripting

matching strings from different files

I want to compare file 1 to file 2 and if a string from file 1 appears in file 2, then print the file 2 row, where the string appears, onto file3. file 1 looks like this. DOG_0004340 blah blah2 j 22424 DOG_3010311 blah blah3 o 24500 DOG_9949221 blah blah6 x 35035 file 2 looks like... (5 Replies)
Discussion started by: verse123
5 Replies

9. Shell Programming and Scripting

Concatenating strings and run it in bash

Hi, all, I tried to write a simple shell script as follow: #!/bin/bash # What want to do in bash is following # : pcd_viewer cloud_cluster_0.pcd cloud_cluster_1.pcd cloud_cluster_2.pcd cloud_cluster_3.pcd cloud_cluster_4.pcd STR = "pcd_viewer" for i in `seq 0 4` do STR... (1 Reply)
Discussion started by: bedeK
1 Replies

10. UNIX for Beginners Questions & Answers

How to extract the partial matching strings among two files?

I have a two file as shown below, file:1 >Contig_152_415 (REVERSE SENSE) >Contig_152_420 (REVERSE SENSE) >Contig_152_472 (REVERSE SENSE) >Contig_152_484 (REVERSE SENSE) File:2 >Contig_152:49081-49929 ATCGAGCAGCGCCGCGTGCGGTGCACCCTTGTGCAGATCGGGAGTAACCACGCGCACGGC... (2 Replies)
Discussion started by: dineshkumarsrk
2 Replies
XtSetArg()																XtSetArg()

Name
  XtSetArg - set a resource name and value in an argument list.

Synopsis
  void XtSetArg(arg, resource_name, value)
	 Arg arg;
	 String resource_name;
	 XtArgVal value;

Inputs
  arg	    Specifies the Arg structure to set.

  resource_name
	    Specifies the name of the resource.

  value     Specifies the value of the resource, or its address.

Description
  XtSetArg()  sets  arg.name to resource_name, and sets arg.value to value.  If the size of the resource is less than or equal to the size of
  an XtArgVal, the resource value is stored directly in value; otherwise, a pointer to it is stored in value.

  XtSetArg() is implemented as the following macro:

     #define XtSetArg(arg, n, d)     ((void)( (arg).name = (n), (arg).value = (XtArgVal)(d) ))

  Because this macro evaluates arg twice, you must not use an expression with autoincrement, autodecrement or other  side  effects  for  this
  argument.

Usage
  Many	Intrinsics  functions  need  to be passed pairs of resource names and values in an ArgList to set or override resource values.	XtSe-
  tArg() is used to set or dynamically change values in an Arg structure or ArgList array.

  Note that in Release 4, a number of functions beginning with the prefix XtVa were added to the Intrinsics.  These functions accept a	NULL-
  terminated variable-length argument list instead of a single ArgList array.  Often these forms of the functions are easier to use.

Example
  XtSetArg() is usually used in a highly stylized manner to minimize the probability of making a mistake; for example:

     Arg args[20];
     int n;
     n = 0;
     XtSetArg(args[n], XtNheight, 100);      n++;
     XtSetArg(args[n], XtNwidth, 200);	     n++;
     XtSetValues(widget, args, n);

  Incrementing	the  array  index  on  the same line means that resource settings can be easily read, inserted, deleted or commented out on a
  line-by-line basis.  If you use this approach, be careful when using XtSetArg() inside an if statement-don't forget to use curly braces  to
  include the increment statement.

  Alternatively, an application can statically declare the argument list:

     static Args args[] = {
	     {XtNheight, (XtArgVal) 100},
	     {XtNwidth, (XtArgVal) 200},
     };
     XtSetValues(Widget, args, XtNumber(args));

Structures
  The Arg and ArgList types are defined as follows:

     typedef struct {
	 String name;
	 XtArgVal value;
     } Arg, *ArgList;

  The definition of XtArgVal differs depending on architecture-its purpose is precisely to make code portable between architectures with dif-
  ferent word sizes.

See Also
  XtMergeArgLists(1), XtNumber(1).

Xt - Argument Lists															XtSetArg()
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy