Sponsored Content
Full Discussion: Select a pattern from file
Top Forums Shell Programming and Scripting Select a pattern from file Post 302332835 by rakeshawasthi on Friday 10th of July 2009 07:29:05 AM
Old 07-10-2009
Quote:
Originally Posted by DTechBuddy
I tried this command:-

cat FileName | sed -e 's#<ABC>[0-9]\+</ABC>##g'

It's not working.
No effect on my FileName. Smilie
You will have to direct this output to a new file and then rename that to FileName.
or use Tee.

Code:
cat FileName | sed -e 's#<ABC>[0-9]\+</ABC>##g' > new_file
mv new_file FileName

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to select lines in unix matches a pattern at a particular position

I have huge file. I want to copy the lines which have first character as 2 or 7, and also which has fist two characters as 90. I need only these records from file. How I can acheive this. Can somebody help me..... (2 Replies)
Discussion started by: cs_banda
2 Replies

2. Shell Programming and Scripting

extract/select pattern from input

Hey, examples of the input (text line): /bla/blMOasdn234.adanif24/blabla.rar /bla/blMOasdn234.adanif24/blabla23124.bin /bla/bla/bla/bla/bla/bla.bin and what I need to do is extract/select only the dir path so the output would be: /bla/blMOasdn234.adanif24/ /bla/blMOasdn234.adanif24/... (4 Replies)
Discussion started by: TehOne
4 Replies

3. Shell Programming and Scripting

Select everything before a pattern

Hi I have i doubt, actually i have to select everything before a word(pattern).For that i am using sed i am using the below line of code but it is not working i am getting a blank instead.. sed -n '/regexp/{g;1!p;};h' file1 Can anyone help? Thanks (15 Replies)
Discussion started by: usha rao
15 Replies

4. Shell Programming and Scripting

select some text from a test dependng on pattern

I have some absolute file location $INSTALL_BASEPATH/onereview-5.0/resources/commons-messages/commonmessages_default.properties $INSTALL_BASEPATH/onereview-5.0/orv-deploy/config-console.war/WEB-INF/classes/com/connectiva/configuration/console/resource/configurationBundle.properties I need to... (3 Replies)
Discussion started by: mnmonu
3 Replies

5. Shell Programming and Scripting

Select everything between first and last occurrence of same pattern

Greetings, I am writing a script which requires as a part, selecting all the lines between the first and last occurrence of a pattern. I have an nawk alternative that is working. But thre should be a generic script that should run on all os viz, linux, sun , aix. The awk script that i... (25 Replies)
Discussion started by: usha rao
25 Replies

6. Shell Programming and Scripting

Select only the last line from the pattern

Hi, I am really new in the shell script, but it is really useful for me to learn. I have one question, I have a large text document (actually few of them), inside there are lines with information about energies, between 10 to 20 of this lines, varies from one doc to another one, my questions... (11 Replies)
Discussion started by: hmartine1983
11 Replies

7. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

8. Shell Programming and Scripting

Modifying the shell script to select pattern

Hello, I have script which work 70% of the desired task , the output from script.sh is following , however the desired output I require is following . Any piece of suggestion would be great.. thanks in advance, emily #!/bin/bash ... (8 Replies)
Discussion started by: emily
8 Replies

9. Shell Programming and Scripting

Big pattern file matching within another pattern file in awk or shell

Hi I need to do a patten match between files . I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time. Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies

10. Shell Programming and Scripting

How do I select certain columns with matching pattern and rest of the lines?

I want to select 2nd, 3rd columns if line has "key3" and print rest of the lines as is. # This is my sample input key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some text key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some... (3 Replies)
Discussion started by: kchinnam
3 Replies
Execute(4)						     Kernel Interfaces Manual							Execute(4)

NAME
Execute - Contains instructions for running commands that require the resources of a remote system SYNOPSIS
/usr/spool/uucp/SystemName/X.RemoteSystemNxxxx DESCRIPTION
The Execute (X.*) files contain instructions for running uucp commands that require the resources of a remote system. They are created by the uux command. The full pathname of a uux command execute file is a form of the following: /usr/spool/uucp/SystemName/X.RemoteSystem- Nxxxx where the SystemName directory is named for the local computer and the RemoteSystem directory is named for the remote system. The N char- acter represents the grade of the work, and the xxxx notation is the 4-digit hexadecimal transfer-sequence number; for example, X.zeusN2121. Note that the grade of the work specifies when the file is to be transmitted during a particular connection. The grade notation is a sin- gle number (0 to 9) or letter (A to Z, a to z). Lower sequence characters cause the file to be transmitted earlier in the connection than do higher sequence characters. The number 0 (zero) is the highest grade, signifying the earliest transmittal; z is the lowest grade, sig- nifying the latest transmittal. The default grade is N. Standard Entries in an Execute File An execute file consists of several lines, each with an identification character and one or more entries: Format and Description U UserName SystemName Specifies the login name of the user issuing the uux command and the name of the system from which the command was issued. N or Z Indicates the error status. The N character means that a failure message is not sent to the user issuing the uux command if the specified command does not exe- cute successfully on the remote system. The Z character means that a failure message is sent to the user issuing the uux command if the specified command does not execute successfully on the remote system. R UserName Specifies the login ID of the user requesting the remote command execution. F FileName Contains the names of the files required to execute the specified command on the remote system. The FileName parameter can be either the complete pathname of the file, including the unique transmission name assigned by the uucp program, or simply the trans- mission name without any path information. The Required File Line can contain zero or more filenames. The uuxqt daemon checks for the existence of all listed files before running the specified command. I FileName Specifies the standard input to be used. The standard input is either specified by a < (less than) symbol in the command string, or is inherited from the standard input of the uux command if that command was issued with the - (dash) flag. If standard input is specified, it also is listed in an F (Required File) line. If standard input is not specified, the uucp program uses the /dev/null device file. O FileName SystemName Specifies the names of the file and system that are to receive standard output from the execution of the command. Standard output is specified by a > (greater than) symbol within the command string. (The >> sequence is not valid in uux commands.) As was the case with standard input, if standard output is not specified, the uucp program uses the /dev/null device file. C CommandString This is the command string that the user requests to be run on the specified system. The uucp program checks the /usr/lib/uucp/Per- missions file on the designated computer to see whether the login ID can run the command on that system. All required files go to the execute file directory, usually /usr/spool/uucp/.Xqtdir. After execution, the standard output is sent to the requested location EXAMPLES
User fong on local system zeus enters the following command: uux - "diff /u/fong/out hera!/u/fong/out2 > ~uucp/DF" This invokes the uux command to run a diff command on the local system, comparing file /u/fong/out with file /u/fong/out2, which is stored on remote system hera. The output of the comparison is placed in the DF file in the public directory on the local system. This command produced the /usr/spool/uucp/hera/X.zeusN212F execute file, which contains the following information: U fong zeus # return status on failure Z # return address for status or input return R fong F /usr/spool/uucp/hera/D.herale954fd out2 O ~uucp/DF zeus C diff /u/fong/out out2 The user line identifies user fong on system zeus. The error status line indicates that fong will receive a failure status message if the diff command fails to execute. The requester is fong, and the file required to execute the command is the following data file: /usr/spool/uucp/hera/D.herale954fd out2 The output of the command is to be written to the public directory on system zeus with the filename DF. (Remember that ~uucp is the shorthand way of specifying the public directory.) The final line is the command string that user fong entered with the uux command. The following is another example of an execute file: U uucp hera # don't return status on failure N # return address for status or input return R uucp F D.hera5eb7f7b I D.hera5eb7f7b C rmail fong This indicates that user uucp on system hera is sending mail to user fong, who is also working on system hera. FILES
Describes access permissions for remote systems Describes accessible remote systems Contains uucp command, data, and execute files Contain instructions for transfers Contains lists of commands that remote systems are permitted to execute Contains files that have been trans- ferred RELATED INFORMATION
Daemons: uuxqt Commands: diff(1), uux(1) delim off Execute(4)
All times are GMT -4. The time now is 01:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy