Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Search a string and display its location on the entire string and make a text file Post 302995034 by RudiC on Friday 31st of March 2017 05:10:28 AM
Old 03-31-2017
Did you consider redirecting the output?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

appending string to text file based on search string

Hi, I need to append string "Hi" to the beginning of the lines containing some specific string. How can I achieve that? Please help. Malay (1 Reply)
Discussion started by: malaymaru
1 Replies

2. Shell Programming and Scripting

Search a string and append text after the string

Hi, I have a file like this... <o t="Batch" id="8410" p="/" g="32"> <a n="name"> <v s="DBBA1MM"/> </a> <a n="owner"> <v r="/Administrator"/> </a> <a n="rights"> <v s="95"/> </a> <a n="debugLevel"> <v s="3"/> </a> <a n="avsStoreLoc"> <v... (8 Replies)
Discussion started by: kesu2k
8 Replies

3. UNIX for Dummies Questions & Answers

Search for a string and copy the entire line

Hello All, I am after the script or the command which can scan the entire file for a string $PART_ID and when found to extract/copy the corresponding $PART_ID value (e.g THIRE_PTY_SOFTWARE for the 1st occurance of $PART_ID in the attached file) to a file. Appreciate your help. Thanks in... (3 Replies)
Discussion started by: forumthreads
3 Replies

4. Shell Programming and Scripting

search for a string in a text file

I want to write a script to check for duplicates For example: I have a text file with information in the format of /etc/passwd alice:x:1008:555:William Williams:/home/bill:/bin/bash bob:x:1018:588:Bobs Boos:/home/bob:/bin/bash bob:x:1019:528:Robt Ross:/home/bob:/bin/bash james:x:1012:518:Tilly... (3 Replies)
Discussion started by: ixDLxi
3 Replies

5. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

6. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

7. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

8. Programming

Search a string in a text file in C

Hello guys, i want some help please in coding that program , " A mini dictionary" the file looks like : Waver --- To be hesitated retirement --- life after end of career The user enter the word , and then it prints the meaning of it Please use CODE tags when... (4 Replies)
Discussion started by: Alyy
4 Replies

9. Shell Programming and Scripting

To Search for a string and to extract the string from the text

Hi Team I have an huge xml where i need to search for a ceratin numbers. For example 2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () - <?xml version="1.0" encoding="UTF-8"... (5 Replies)
Discussion started by: Kannannair
5 Replies

10. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies
PEXEC(1)							   User Commands							  PEXEC(1)

NAME
pexec - executing commands in parallel SYNOPSIS
pexec [options] [-c|-m] [--] command [arguments] | 'compound command' DESCRIPTION
Execute commands or shell scripts in parallel on a single host or on remote hosts using a remote shell. OPTIONS
General options: -h, --help Gives general summary about the command line options. --long-help Gives a detailed list of command line options. --version Gives some version information about the program. -s, --shell <shell> Full path (e.g. /bin/sh) of the shell or interpreter to be used for script execution. -c, --shell-command Use the specified shell to interpret the command(s) instead of direct execution. -m, --multiple-command Allow multiple individual shell command scripts to be executed in parallel with the variation of the parameters. -e, --environment <variable> Name of an environmental variable which is set to the respective parameter before each execution. -n, --number <number> The maximal number of processes running simultaneously. The <number> itself can even be a complex specification of remote hosts (see documentation for more details). -C, --control <port> The control port of a hypervisor daemon (full path of a UNIX socket or an INET host specification). -p, --list <list> The single-argument form of main parameter list. -r, --parameters <list> The multiple-argument form of the main parameter list. -f, --listfile <file> The main parameter list file. -w, --column <index> The column index from where the parameters should be taken if they are read from a parameter file. -t, --complete Threat the whole line as a single parameter if the parameters are read from a file. -z, --nice Sets the scheduling priority of pexec and all children (executed processes) to the priority defined by this nice value. -- A marker after which the command to execute begins. Redirecting standard input, output and error: -i, --input <input> The (optionally formatted) name of the input file which is used for redirecting the standard input. -o, --output <output> The (optionally formatted) name of the output file which is used for redirecting the standard output. -u, --error <output> The (optionally formatted) name of the output error file, which is used for redirecting the standard error. -R, --normal-redirection Equivalent to specifying --output -, --error - and --input /dev/null. -a, --output-format <format> The format of the final standard output redirection if the output of all of the processes are gathered into the same file. -b, --error-format <format> The same final redirection format for the standard error. -x, --omit-newlines Disable automatic newlines after the output and error formats. Execution using remote hosts: -g, --remote-shell <remote_shell> The name or full path of the remote shell to be used for building the tunnel between the local and the peer host(s). Default: ``/usr/bin/ssh''. -P, --pexec <pexec> The full path of the pexec program on the remote hosts. If this option is omitted, pexec tries to figure out from the invoking syn- tax and/or the current path. -T, --tunnel Internal use only (pexec will start in tunnel daemon mode). Remote control, mutual exclusions and atomic command execution: -y, --bind <port> This option lets pexec to be remote controlled via INET or UNIX domain sockets. -E, --pexec-connection-variable <env> This option overrides the default environment name PEXEC_REMOTE_PORT to the specified value, which is used by the ``-p|--connect auto'' combination to determine the control socket with which the running pexec instance can be controlled. -j, --remote Used to remote control and/or poll the status of other running instances of pexec. -p, --connect <port> Remote control port to connect to. -t, --status Prints the actual status of the running jobs in a human-readable form. -l, --lock <mutex> Locks the specified mutex (if the mutex is not locked by someone else, otherwise it will block until the mutex is released). -u, --unlock <mutex> Unlocks the specified mutex. -m, --mutex <mutex> Name of the mutex. -d, --dump <filename> Dump the content of the given file to standard output, if ``-m|--mutex'' is given, this will be atomic. -s, --save <filename> Save the content of standard input to the given file, if ``-m|--mutex'' is given, this will be atomic. -a, --atomic <command> Execute the given command. If ``-m|--mutex'' is given, the exectution is going to be atomic with respect to that mutex. Hypervisor mode: -H, --hypervisor Starts pexec in hypervisor mode. -C, --control <port> The control port used by the hypervisor. -l, --load <window> Use load also to limit the number of simultaneous processes with the specified load average interval (0, 1 or 2, or 1min, 5min or 15min, respectively). -f, --fifo First in first out queue processing. -s, --lifo Last in first out (stack) queue processing (default). Logging: -L, --log <file> The name of the log file. -W, --log-level <level> The logging level. -V, --verbose Increase the log level by one. REPORTING BUGS
Report bugs to <apal@szofi.elte.hu> COPYRIGHT
Copyright (C) 2007, 2008-2009; Pal, Andras <apal@szofi.elte.hu> This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. This software was written by Andras Pal. The core part was written while working for the Hungarian-made Automated Telescope (HAT) project to make the data processing more easier and therefore find many-many extrasolar planets. See more information about this project: http://hatnet.hu. Another internal libraries (e.g. numhash.[ch]) were primarily written for other projects. SEE ALSO
The full documentation for pexec is maintained as a Texinfo manual. If the info and pexec programs are properly installed at your site, the command info pexec should give you access to the complete manual. pexec 1.0rc8 (2009.07.02) June 2012 PEXEC(1)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy