Find, Grep and then Sed

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find, Grep and then Sed
# 8  
Old 10-19-2009
bash: !: event not found

wat may have caused this?

I hate the history expansion, so I put this in my profile:
set +H

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find=grep or maybe sed/awk for multiple lines of text?

Hi, I am running the following: PASS="username/password" sqlplus -s << EOF | grep -v "^$" $PASS set feedback off set heading off set termout off select name from v\$database ; exit EOF Which gives ERROR: ORA-28002: the password will expire within 5 days PSMP1 (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Shell Programming and Scripting

Help with Passing the Output of grep to sed command - to find and replace a string in a file.

I have a file example.txt as follows :SomeTextGoesHere $$TODAY_DT=20140818 $$TODAY_DT=20140818 $$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script. (It would even be better if I could pass... (5 Replies)
Discussion started by: SriRamKrish
5 Replies

3. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

4. UNIX for Dummies Questions & Answers

find/xargs/*grep: find multi-line empty "try-catch" blocks - eg, missing ; not in a commented block

How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases? This would seem to involve find, xargs, *grep, regex, etc. In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies

5. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

6. Homework & Coursework Questions

find grep sed commands homework

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have to make as home work several commands with gerp find and sed 2. Relevant commands, code, scripts, algorithms: FIND command -use command find... (8 Replies)
Discussion started by: ViruS89
8 Replies

7. Shell Programming and Scripting

Find and Rename files using (find mv and sed)

In response to a closed thread for degraff63 at the following command might do it as some shells spit it without the "exec bash -c " part: Find . -name "*.model" -exec bash -c "mv {} \`echo {} | sed -e 's//_/g'\`"... (0 Replies)
Discussion started by: rupert160
0 Replies

8. UNIX for Dummies Questions & Answers

using sed or grep to find exact match of text

Hi, Can anyone help me with the text editing I need here. I have a file that contains the following lines for example: (line numbers are for illustration only) 1 Hello world fantasy. 2 Hello worldfuntastic. 3 Hello world wonderful. I would like to get all those lines of text that... (5 Replies)
Discussion started by: risk_sly
5 Replies

9. Shell Programming and Scripting

Complex find grep or sed command

Haven't worked in bash for ages. did a good bit of shell scripting in regular sh, but have forgotten most of it. I have several thousand php files that now include the following line at the end of the file. There is no LF or CR/LF before it begins, it is just concatenated to the final line of... (3 Replies)
Discussion started by: sjburden
3 Replies

10. Shell Programming and Scripting

grep and sed to find a pattern and add newline

Hello All, I have log file the result from a multithreaded process. So when a process finishes it will write to this log file as 123 rows merged. The issue is sometimes the processess finish at the same time or write to the file at the same time as 123 rows merged.145 rows merged. At... (5 Replies)
Discussion started by: ssikhar
5 Replies
Login or Register to Ask a Question
POE::Filter::Grep(3pm)					User Contributed Perl Documentation				    POE::Filter::Grep(3pm)

POE::Filter::Grep - select or remove items based on simple rules SYNOPSIS
#!perl use POE qw( Wheel::FollowTail Filter::Line Filter::Grep Filter::Stackable ); POE::Session->create( inline_states => { _start => sub { my $parse_input_as_lines = POE::Filter::Line->new(); my $select_sudo_log_lines = POE::Filter::Grep->new( Put => sub { 1 }, Get => sub { my $input = shift; return $input =~ /sudo[d+]/i; }, ); my $filter_stack = POE::Filter::Stackable->new( Filters => [ $parse_input_as_lines, # first on get, last on put $select_sudo_log_lines, # first on put, last on get ] ); $_[HEAP]{tailor} = POE::Wheel::FollowTail->new( Filename => "/var/log/system.log", InputEvent => "got_log_line", Filter => $filter_stack, ); }, got_log_line => sub { print "Log: $_[ARG0] "; } } ); POE::Kernel->run(); exit; DESCRIPTION
POE::Filter::Grep selects or removes items based on simple tests. It may be used to filter input, output, or both. This filter is named and modeled after Perl's built-in grep() function. POE::Filter::Grep is designed to be combined with other filters through POE::Filter::Stackable. In the "SYNOPSIS" example, a filter stack is created to parse logs as lines and remove all entries that don't pertain to a sudo process. (Or if your glass is half full, the stack only selects entries that DO mention sudo.) PUBLIC FILTER METHODS
In addition to the usual POE::Filter methods, POE::Filter::Grep also supports the following. new new() constructs a new POE::Filter::Grep object. It must either be called with a single Code parameter, or both a Put and a Get parameter. The values for Code, Put, and Get are code references that, when invoked, return true to select an item or false to reject it. A Code function will be used for both input and output, while Get and Put functions allow input and output to be filtered in different ways. The item in question will be passed as the function's sole parameter. sub reject_bidoofs { my $pokemon = shift; return 1 if $pokemon ne "bidoof"; return; } my $gotta_catch_nearly_all = POE::Filter::Grep->new( Code => &reject_bidoofs, ); Enforce read-only behavior: my $read_only = POE::Filter::Grep->new( Get => sub { 1 }, Put => sub { 0 }, ); modify modify() changes a POE::Filter::Grep object's behavior at run-time. It accepts the same parameters as new(), and it replaces the existing tests with new ones. # Don't give away our Dialgas. $gotta_catch_nearly_all->modify( Get => sub { 1 }, Put => sub { return shift() ne "dialga" }, ); SEE ALSO
POE::Filter for more information about filters in general. POE::Filter::Stackable for more details on stacking filters. BUGS
None known. AUTHORS &; COPYRIGHTS The Grep filter was contributed by Dieter Pearcey. Documentation is provided by Rocco Caputo. Please see the POE manpage for more information about authors and contributors. perl v5.14.2 2012-05-15 POE::Filter::Grep(3pm)