hi,
i'm trying to erase all the characters after, and including, the first test test
Output: test1 test2 test3
this is what I tried, but didn't work
sed "s/*//" file > testfilename
any suggestions?
thanks,
gammmaman (2 Replies)
i need to use sed to remove an entire line containing a pattern stored in a variable say $var1
this var1 will be a URL and will therefore contain slashes
any help would be greatly appreciated (1 Reply)
I been trying to get this right. I have trying to get rid of spaces in between the character < and the character >. Everytime I try, sed gets too greedy and do the whole line.
Ex.
< T AG 1> Hello, how are you doing?
<Tag 2> I am doing fine.
I want this:
<TAG1> Hello, how are you... (6 Replies)
Hello
I have a document and in this document I have several occurrence of "VAR == xxxxxxx" and xxxxx can be anything. I don't know what it is. I want to replace the 'xxxxx's with something I know.
What I know however, is the line numbers of the VAR =='s in the file.
How can I replace... (1 Reply)
I am working with bash on HP-UX server at school.
As practice for scripting, I am trying to make a pretend server admin script that adds a user to the system, deletes a user from the system, and lists all users of the pretend system. I have accomplished this with a select loop. Adding users, and... (2 Replies)
Hi gurus,
I'd like to change this complete line on a file:
BAN_COMMAND="/etc/apf/apf -d $ATTACK_HOST {bfd.$MOD}"
to this one:
BAN_COMMAND="/sbin/iptables -A INPUT -s $ATTACK_HOST -j DROP"
I've tried a lot without any successful . :(
thanks in advance
Israel. (2 Replies)
Greetings everyone. Right now I am working on a script to be used during automated deployment of servers. What I have to do is remove localhost.localdomain and localhost6.localdomain6 from the /etc/hosts file. Simple, right? Except most of the examples I've found using sed want to delete the entire... (4 Replies)
Hello Friends, How can I remove the last two values of this line using sed
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900
The result should look like this:
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
All:
Can somebody help me out with a sed command, which removes the the first occurance of ')' until the end of the line
If I have the following input
... (5 Replies)
Hello Friends
I want to use sed command to pick a part of line. FOr example I only need the
/home_put1/bidds/myfo
part of following line
fish://ulavet@rits1.ula.com.tr/home_put1/bidds/myfo
How can I do this bu using sed command ? (2 Replies)
Discussion started by: rpf
2 Replies
LEARN ABOUT MINIX
grep
GREP(1) General Commands Manual GREP(1)NAME
grep - search a file for lines containing a given pattern
SYNOPSIS
grep [-elnsv] pattern [file] ...
OPTIONS -e-e pattern is the same as pattern
-c Print a count of lines matched
-i Ignore case
-l Print file names, no lines
-n Print line numbers
-s Status only, no printed output
-v Select lines that do not match
EXAMPLES
grep mouse file # Find lines in file containing mouse
grep [0-9] file # Print lines containing a digit
DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions
accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1
occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a
match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is
returned.
SEE ALSO cgrep(1), fgrep(1), sed(1), awk(9).
GREP(1)