Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to read contents of a file from a given line number upto line number again specified by user Post 302436785 by grc on Tuesday 13th of July 2010 07:04:26 AM
Old 07-13-2010
how to get the solution using command line arguments?

Thank you all for the reply.

I am passing the parameters as command line arguments. In that case how do I get the desired result?

Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line number to each line and getting total number of lines

Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me. I have a file say: abc def ccc ddd ffff The output should be: Instance1=abc Instance2=def Instance3=ccc Instance4=ddd Instance5=ffff ... (2 Replies)
Discussion started by: chiru_h
2 Replies

2. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

3. Shell Programming and Scripting

how to get the data from line number 1 to line number 100 of a file

Hi Everybody, I am trying to write a script that will get some perticuler data from a file and redirect to a file. My Question is, I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line. I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies

4. Shell Programming and Scripting

Read the specified line number from file

Hi Guys, I am new to unix. Actually i want help in writing an single command where i can actually read specific line number in file where the line number will be passed to command as parameter. ex. 1 a 2 b 3 c 4 d And to my command i pass as 2. so i should get output as 2 b ... (15 Replies)
Discussion started by: kam786sim
15 Replies

5. Shell Programming and Scripting

move contents from one file to another based on line number or content

I want a script that will move everything beyond a certain line number or beyond a certain content word into another file. For example, if file A has this: first line second line third line forth line fifth line sixth line I want to run a script that will move everything beyond the third... (4 Replies)
Discussion started by: robp2175
4 Replies

6. Shell Programming and Scripting

Read flat file upto certain number of columns

Hello Guys Please help me with the below issue I want to read a flat file source upto certain number of columns Say my flat file has 30 columns but I want to read upto 25 columns only How come the above issue can be addressed? Thanks a lot!!!! (1 Reply)
Discussion started by: Pratik4891
1 Replies

7. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

8. Shell Programming and Scripting

Write $line number into textfile and read from line number

Hello everyone, I don't really know anything about scripting, but I have to manage to make this script, out of necessity. #!/bin/bash while read -r line; do #I'm reading from a big wordlist instructions using $line done Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies

9. Shell Programming and Scripting

How to read a file starting at certain line number?

I am new to ksh scripts. I would like to be able to read a file line by line from a certain line number. I have a specific line number saved in a variable, say $lineNumber. How can I start reading the file from the line number saved in $lineNumber? Thanks! (4 Replies)
Discussion started by: dcowboys13
4 Replies

10. Shell Programming and Scripting

Adding user name to file, and then displaying new line number

Hi all - I'm completely stumped by a script I'm working on... The short version is I have a file called 'lookup' and in it are hundreds of names (first and last). I have a script that basically allows the user to enter a name, and what I need to have happen is something like this: Record... (8 Replies)
Discussion started by: sabster
8 Replies
REG_HOSTER(3PVM)						  PVM Version 3.4						  REG_HOSTER(3PVM)

NAME
pvm_reg_hoster - Register task as PVM slave starter. SYNOPSIS
C #include <pvmsdpro.h> int cc = pvm_reg_hoster() Fortran Not Available DESCRIPTION
Registers the calling task as a PVM slave pvmd starter. When the master pvmd receives a DM_ADD message, instead of starting the new slave pvmd processes itself, it passes a message to the hoster, which does the dirty work and sends a message back to the pvmd. Note: This function isn't for beginners. If you don't grok what it does, you probably don't need it. For a more complete explanation of what's going on here, you should refer to the PVM source code and/or user guide section on implementation; this is just a man page. That said... When the master pvmd receives a DM_ADD message (request to add hosts to the virtual machine), it looks up the new host IP addresses, gets parameters from the host file if it was started with one, and sets default parameters. It then either attempts to start the processes (using rsh or rexec()) or, if a hoster has registered, sends it a SM_STHOST message. The format of the SM_STHOST message is: int nhosts // number of hosts { int tid // of host string options // from hostfile so= field string login // in form ``[username@]hostname.domain'' string command // to run on remote host } [nhosts] The hoster should attempt to run each command on each host and record the result. A command usually looks like: $PVM_ROOT/lib/pvmd -s -d8 -nhonk 1 80a9ca95:0f5a 4096 3 80a95c43:0000 and a reply from a slave pvmd like: ddpro<2312> arch<ALPHA> ip<80a95c43:0b3f> mtu<4096> When finished, the hoster should send a SM_STHOSTACK message back to the address of the sender (the master pvmd). The format of the reply message is: { int tid // of host, must match request string status // result line from slave or error code } [] // implied count The TIDs in the reply must match those in the request. They may be in a different order, however. The result string should contain the entire reply (a single line) from each new slave pvmd, or an error code if something went wrong. Legal error codes are the literal names of the pvm_errno codes, for example ``PvmCantStart''. The default PVM hoster can return PvmDSysErr or PvmCantStart, and the slave pvmd itself can return PvmDupHost. The hoster must use pvm_setmwid() to set the wait ID in the reply message to the same value as in the request. The wait ID in the request is obtained by calling pvm_getmwid(). The hoster task must use pvm_setopt(PvmResvTids, 1) to allow sending reserved messages. Messages should be packed using encoding Pvm- DataDefault to ensure they can be unpacked anywhere in the system. pvm_reg_hoster() returns PvmOk when successful. SEE ALSO
pvm_addhosts(3PVM), pvm_config(3PVM), pvm_setmwid(3PVM) 4 March, 1994 REG_HOSTER(3PVM)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy