Sponsored Content
Top Forums Shell Programming and Scripting remove contents including the tag if pattern matches Post 302527380 by kumaran_5555 on Friday 3rd of June 2011 07:47:01 AM
Old 06-03-2011
Please post some input sample and desired output .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting XML Tag Contents

Hi Jean I require your help in writing a shell script. Iam zero in Unix programming. I have a large file about 400 MB of data, which contains about 50000 XML messages seperated by a Tab, I think. I need to extract only 4 values from each XML message and write it onto a new file. Please help me... (2 Replies)
Discussion started by: pk_eee
2 Replies

2. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

3. Shell Programming and Scripting

Remove if the above line matches pattern

but keep if does not I have a file: --> my.out foo: bar foo: moo blarg i am on vacation foo: goose foo: lucy foo: moose foo: stucky groover@monkey.org foo: bozo grimace@gonzo.net dear sir - blargo blargo foo: goon foo: sloppy foo: saudi gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies

4. Shell Programming and Scripting

Search for Pattern and Print including Lines in between

Gurus, I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below: Name: xxxx yyyy nnnn Description: dfffgs sdgsgsf hsfhhs afgghhjdgj fjklllll gsfhfh Updated: jafgadsgg gsg Corrected: date today The file consists of line like these. ... (13 Replies)
Discussion started by: The One
13 Replies

5. Shell Programming and Scripting

NAWK to remove lines that matches a specific pattern

Hi, I have requirement that I need to split my input file into two files based on a search pattern "abc" For eg. my input file has below content abc defgh zyx I need file 1 with abc and file2 with defgh zyx I can use grep command to acheive this. But with grep I need... (8 Replies)
Discussion started by: sbhuvana20
8 Replies

6. UNIX for Dummies Questions & Answers

If user input matches file contents

I was wondering how I can read values from a file and then proceed if those values match a user input. For example (a simple one), a user inputs their name, then we check if that name is in a file of usernames. If it is, it says proceed, if not, then it says you are not authorized. ... (5 Replies)
Discussion started by: DBnixUser
5 Replies

7. Shell Programming and Scripting

How to use ls with pattern and including path?

Hello to all, Maybe someone could help me, my question is: How can a filter the print of command ls for the files with names of the form "abc*.txt" including the path? I've done this: If I move with command cd to /My/Path/Is/This/ and send this command: ls -lst abc*.txt -i... (37 Replies)
Discussion started by: Ophiuchus
37 Replies

8. Shell Programming and Scripting

Remove entire line from a file if 1st column matches a pattern

I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID Scenario is: delete all line if Employee Number (1st column) contains below 1. Non-numeric Employee Number 2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies

9. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies

10. Shell Programming and Scripting

Delete a pattern including any whitespace before it and after it

Hello. A_LIGNE="cnezJ,V ,FMZ fd,Mok CODKJ,F SOME_WORD fcnQ, VMQKV Q" A_PATTERN="SOME_WORD" sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove 'SOME_WORD' and give : "cnezJ,V ,FMZ fd,Mok CODKJ,F fcnQ, VMQKV Q"A_PATTERN="SOME_WORD]" sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove... (4 Replies)
Discussion started by: jcdole
4 Replies
BIND(2) 							System Calls Manual							   BIND(2)

NAME
bind, mount, unmount - change name space SYNOPSIS
#include <u.h> #include <libc.h> int bind(char *name, char *old, int flag) int mount(int fd, char *old, int flag, char *aname) int unmount(char *name, char *old) DESCRIPTION
Bind and mount modify the file name space of the current process and other processes in its name space group (see fork(2)). For both calls, old is the name of an existing file or directory in the current name space where the modification is to be made. The name old is evaluated as described in intro(2), except that no translation of the final path element is done. For bind, name is the name of another (or possibly the same) existing file or directory in the current name space. After a successful bind call, the file name old is an alias for the object originally named by name; if the modification doesn't hide it, name will also still refer to its original file. The evaluation of new happens at the time of the bind, not when the binding is later used. The fd argument to mount is a file descriptor of an open network connection or pipe to a file server. The old file must be a directory. After a successful mount the file tree served (see below) by fd will be visible with its root directory having name old. The flag controls details of the modification made to the name space. In the following, new refers to the file as defined by name or the root directory served by fd. Either both old and new files must be directories, or both must not be directories. Flag can be one of: MREPL Replace the old file by the new one. Henceforth, an evaluation of old will be translated to the new file. If they are directories (for mount, this condition is true by definition), old becomes a union directory consisting of one directory (the new file). MBEFORE Both the old and new files must be directories. Add the constituent files of the new directory to the union directory at old so its contents appear first in the union. After an MBEFORE bind or mount, the new directory will be searched first when evaluating file names in the union directory. MAFTER Like MBEFORE but the new directory goes at the end of the union. The flags are defined in <libc.h>. In addition, there is an MCREATE flag that can be OR'd with any of the above. When a create system call (see open(2)) attempts to create in a union directory, and the file does not exist, the elements of the union are searched in order until one is found with MCREATE set. The file is created in that directory; if that attempt fails, the create fails. With mount, the file descriptor fd must be open for reading and writing and prepared to respond to 9P messages (see Section 5). After the mount, the file tree starting at old is served by a kernel mnt(3) device. That device will turn operations in the tree into messages on fd. Aname selects among different file trees on the server; the null string chooses the default tree. The file descriptor fd is automatically closed by a successful mount call. The effects of bind and mount can be undone by unmount. If name is zero, everything bound to or mounted upon old is unbound or unmounted. If name is not zero, it is evaluated as described above for bind, and the effect of binding or mounting that particular result on old is undone. SOURCE
/sys/src/libc/9syscall SEE ALSO
bind(1), intro(2), fcall(2), auth(2) (particularly amount), intro(5), mnt(3), srv(3) DIAGNOSTICS
The return value is a positive integer (a unique sequence number) for success, -1 for failure. These routines set errstr. BUGS
Mount will not return until it has successfully attached to the file server, so the process doing a mount cannot be the one serving. BIND(2)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy