Suppose we have a folder named Project.
I would like find each file in the folder that contains the pattern &$
at the function call.
For example should replace:
AnyFunction(&$arg);
with
AnyFunction(&$arg);
Where AnyFunction is an unknown function that matches the pattern.
I need this to try to solve this php problem.
How can I perform this?
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance
I'm trying to replace the contents of a github repository with the contents of a folder. I've tried git push, but it doesn't seem to do anything unless I add each of the files individually using the command line. Is there any command that I can use to replace the contents of the repository with the folder's contents?
My repository is here: https://github.com/jarble/downloadedModules
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e options (if possible)? as I want to replace multiple lines in a single file.
Thanks
Robert
HI Folks,
I'm looking for a solution for this issue.
I want to find the Pattern 0[0-9]/ and replace it with [0-9]/. I'm just removing the leading zero.
I'm on Solaris 10 and I have tested the following with ksh(88), bash(3.00) and zsh(4.2.1).
The following code doesn't yield any result:
function foo {
echo "Hello World"
}
find somedir -exec foo \;
The find does match several files (as shown by replacing -exec ...
Hi ,
I want to print the nth and n+1 lines from a file once it gets a pattern match.
For eg:
aaa
bbb
ccc
ddd
gh
jjjj
If I find a match for bbb then I need to print bbb as well as 3rd and 4th line from the match.. Please help..Is it possible to get a command using sed :)
Hi everyone,
I am new to shell scripting, and would appreciate your help on following problem.
I need to search a file for a pattern, then get the number of each line that matches the given pattern.
Then I need to search those specific line numbers from the first file in a second file and print the entire lines.
I tried with grep -n 'pattern' from the first file, which gives me:
21: pat
I'm trying to find all files whose name matches certain C++ file extensions but exclude certain directories matching a pattern with this:
find /home/palchan/code -name "*.[CcHh]" -o -name "*.cpp" -o -name "*.hpp" -a !