Sponsored Content
Top Forums UNIX for Dummies Questions & Answers emulating cat in sed with q option Post 302585391 by pandeesh on Wednesday 28th of December 2011 09:51:09 AM
Old 12-28-2011
Yes. But the thing is we don't know the number of lines in the file. It may be dynamic.
Is there any one liner available using "q" in this case?
We can do it after finding wc -l , then using "q" in sed.
But is there any other smarter way?
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

use of sed over cat to merge files

I have three files, basically: file 1 - one line header file 2 - big data (approx 80GB) file 3 - a one line trailer the existing process cats these together i.e cat file 1 file 2 file 3 however... I was thinking, surely it could be more efficient to insert the header (file 1) on the... (2 Replies)
Discussion started by: miwinter
2 Replies

2. UNIX for Dummies Questions & Answers

tr, sed, awk, cat or scripting

I need to change all Newline caracters (\12) to Fieldseparator(\34). tr -A '\12' '\34' <file1> file2 Replace all delete (\177) with Newline (\12) tr -A '\177' '\12' <file2> file3 Put the name of the file first in all rows. awk '{printf "%s\34%s\n", FILENAME,$0} file3 > file4 So far no... (6 Replies)
Discussion started by: MrKlint
6 Replies

3. Shell Programming and Scripting

Help on cat with sed!

Hi All! I have a script having one statement like. cat xfile | sed 's/A/a/g' > xfile I have two boxes which have similar version of linux running but one is greater in speed compared to other. Lets say A is faster than B. A which is faster writes output as NULL B which... (6 Replies)
Discussion started by: kbalaji_uk
6 Replies

4. Shell Programming and Scripting

want to pass sentence with SED and CAT

I have to pass a sentence in a file, the specs are as: cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed 's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' > runx... (1 Reply)
Discussion started by: patilrakesh1984
1 Replies

5. Shell Programming and Scripting

grep or cat using sed

Is there a way using grep or cat a file to create a new file based on whether the first 9 positions of each record is less than 399999999? This is a fixed file format. (3 Replies)
Discussion started by: ski
3 Replies

6. UNIX for Dummies Questions & Answers

sed -i option example

Can anyone give detailed and example for sed -i option. Where can we use this option?:) (3 Replies)
Discussion started by: gwgreen1
3 Replies

7. Shell Programming and Scripting

sed 'b' option

Hi, What does the following command do on files? sed '1b; $d' To me it just deletes the last line of the file. If so what is the significance of sed's 'b' option? Thanks (1 Reply)
Discussion started by: royalibrahim
1 Replies

8. Shell Programming and Scripting

sed with -e option

sed "s/^/8,A1,$dat,id2_3,/g" -e sed "s/$/,,,,,,,,,,,/g" temporary wn m running this script m getting a error... plz help me with this.... O/p sed: -e expression #1, char 3: unterminated `s' command ---------- Post updated at 11:35 AM ---------- Previous update was at 11:33 AM... (7 Replies)
Discussion started by: nikhil jain
7 Replies

9. Shell Programming and Scripting

sed -n option

Hi i am facing problem with sed -n option could you please help me on this, i have a file test the contents of the file is width="75">10/0 4/12</td>^M><a href='courtorders/100412zr.pdf' target="_blank">Miscellaneous Order</a></td>^M width="75">10/01/12</td>^M><a href='courtorde... (8 Replies)
Discussion started by: ragilla
8 Replies

10. UNIX for Dummies Questions & Answers

How to cat via ssh and sed at the same time.?

I am trying to write a script to automatically create conf files and remote servers. I would like to do all this without creating files locally and copying them . Here is what I have tried. sitename=$1 prodserver=$2 ssh $prodserver "cat > /data/$sitename.conf" << cat |sed... (5 Replies)
Discussion started by: macrossm
5 Replies
pvs(1)                                                             User Commands                                                            pvs(1)

NAME
pvs - display the internal version information of dynamic objects SYNOPSIS
pvs [-Cdlnorsv] [-N name] file... DESCRIPTION
The pvs utility displays any internal version information contained within an ELF file. Commonly, these files are dynamic executables and shared objects, and possibly relocatable objects. This version information can fall into one of two categories: o version definitions o version dependencies Version definitions describe the interfaces that are made available by an ELF file. Each version definition is associated to a set of global symbols provided by the file. Version definitions can be assigned to a file during its creation by the link-editor using the -M option and the associated mapfile directives. See the Linker and Libraries Guide for more details. Version dependencies describe the binding requirements of dynamic objects on the version definitions of any shared object dependencies. When a dynamic object is built with a shared object, the link-editor records information within the dynamic object indicating that the shared object is a dependency. This dependency must be satisfied at runtime. If the shared object also contains version definitions, then those version definitions that satisfy the global symbol requirements of the dynamic object are also recorded in the dynamic object being created. At process initialization, the runtime linker uses any version dependencies as a means of validating the interface requirements of the dynamic objects used to construct the process. OPTIONS
The following options are supported. If neither the -d or -r options are specified, both are enabled. -C Demangles C++ symbol names. -d Prints version definition information. -l When used with the -s option, prints any symbols that have been reduced from global to local binding due to versioning. By conven- tion, these symbol entries are located in the .symtab section, and fall between the FILE symbol representing the output file, and the FILE symbol representing the first input file used to generate the output file. These reduced symbol entries are assigned the fabricated version definition _REDUCED_. No reduced symbols will be printed if the file has been stripped (see strip(1)), or if the symbol entry convention cannot be determined. -n Normalizes version definition information. By default, all version definitions within the object are displayed. However, version definitions can inherit other version definitions. Under normalization, only the head of each inheritance list is displayed. -N name When used with the -d option, -N prints only the information for the given version definition name and any of its inherited ver- sion definitions. When used with the -r option, -N prints only the information for the given dependency file name. -o Creates one-line version definition output. By default, file, version definitions, and any symbol output is indented to ease human inspection. This option prefixes each output line with the file and version definition name and can be more useful for analysis with automated tools. -r Prints version dependency (requirements) information. -s Prints the symbols associated with each version definition. Any data symbols are accompanied with the size, in bytes, of the data item. -v Verbose output. Indicates any weak version definitions, and any version definition inheritance. When used with the -N and -d options, the inheritance of the base version definition is also shown. When used with the -s option, the version symbol definition is also shown. OPERANDS
The following operands are supported. file The ELF file about which internal version information is displayed. EXAMPLES
Example 1: Displaying version definitions The following example displays the version definitions of libelf.so.1: % pvs -d /lib/libelf.so.1 libelf.so.1; SUNW_1.1 Example 2: Creating a one-liner display A normalized, one-liner display, suitable for creating a mapfile version control directive, can be created using the -n and -o options: % pvs -don /lib/libelf.so.1 /lib/libelf.so.1 - SUNW_1.1; Example 3: Displaying version requirements The following example displays the version requirements of ldd and pvs: % pvs -r /usr/bin/ldd /usr/bin/pvs /usr/bin/ldd: libelf.so.1 (SUNW_1.1); libc.so.1 (SUNW_1.1); /usr/bin/pvs: libelf.so.1 (SUNW_1.1); libc.so.1 (SUNW_1.1); EXIT STATUS
If the requested version information is not found, a non-zero value is returned. Otherwise, a 0 value is returned. Version information is determined not found when any of the following is true: o the -d option is specified and no version definitions are found. o the -r option is specified and no version requirements are found. o neither the -d nor -r option is specified and no version definitions or version requirements are found. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtoo | +-----------------------------+-----------------------------+ SEE ALSO
ld(1), ldd(1), strip(1), elf(3ELF), attributes(5) Linker and Libraries Guide SunOS 5.10 14 Apr 2004 pvs(1)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy