Search Results

Search: Posts Made By: grep_me
6,480
Posted By grep_me
Right, I am aware of that Jim. But I want only...
Right, I am aware of that Jim. But I want only the exact words to be replaced. Not all.
It should not remove the Bottle from "Bottle.Water".
Is there a way to tell sed to treat dots like...
6,480
Posted By grep_me
sed Exact Match when Dot is present
I am trying to replace exact word from my text. I know using the angled brackets does the trick. But it is not working when there is a dot in the text.

echo "Bottle BottleWater Bottle Can" | sed...
1,970
Posted By grep_me
Thanks for your time Don. Really appreciate your...
Thanks for your time Don. Really appreciate your help.
1,970
Posted By grep_me
Hi Jim - Here is my OS: $>uname -o ...
Hi Jim - Here is my OS:

$>uname -o
GNU/Linux
And I am trying to reduce my lines in my code, hoping that awk or sed has something to take care of case even for the replace code.

Don - it...
1,970
Posted By grep_me
Find & Replace with same case letters
I have text with upper and lower case words. I want to find something and replace it with something new. But it should match the case - Meaning - it should replace old upper cased word with NEW upper...
2,288
Posted By grep_me
If this is onetime thing, open the xml (which is...
If this is onetime thing, open the xml (which is complete has no errors) using MS excel. It has got an inbuilt parser which will open the xml as a table and you can view whatever fields you want in...
17,628
Posted By grep_me
Bartus' method would insert only into 2 files.......
Bartus' method would insert only into 2 files....
try balajesuri's code if you have more than 2 files.
rather than piling up the names in or loop, put the filenames in a txt file and use that in...
2,332
Posted By grep_me
explore these options...and add a if loop to...
explore these options...and add a if loop to check for the weekday
date '+%A' #Prints whole weekday eg:Wednesday
date '+%u' #Prints 1-7 (Mon to Sun)
date '+%w' #Prints 0-7 (Sub to Mon)
2,188
Posted By grep_me
You can do this for flnm in `ls -1` do ...
You can do this
for flnm in `ls -1`
do
./test.sh $flnm
done
2,002
Posted By grep_me
Write a generic wrapper to run all the sql...
Write a generic wrapper to run all the sql commands.(put the "sqplus" command in the wrapper which accepts dbname, sql file etc as parameters)
and call the wrapper twice in this file.sh script of...
2,188
Posted By grep_me
Rather than an alias, create a function for this...
Rather than an alias, create a function for this (this is in korn shell)
k() { str="$1"; pth="$2; grep -i $str $pth ; }
2,241
Posted By grep_me
set TMOUT to 0
set TMOUT to 0
2,781
Posted By grep_me
source is command to execute other shell...
source is command to execute other shell commands, so if you say
source foo
it will try to run the command foo (alias in this case)
If foo is a script why are you using source command to run...
2,629
Posted By grep_me
I am not sure I understand your question here. ...
I am not sure I understand your question here.
What is a "bin"?
Can you please post your example with a clear explanation.
1,777
Posted By grep_me
You have to have a key for the files to join. ...
You have to have a key for the files to join.
Please make your files to have a key like this

--File1
1 test1
1 test2
1 test3


--File2
1 is bad
1 is not bad


And run this command:...
4,284
Posted By grep_me
Why do you have it as test/test123@$dbname for...
Why do you have it as test/test123@$dbname for user and pswd?
use this:
sqlplus -S ${USERID}/${PASSWD}@${dbname} << EOF
6,156
Posted By grep_me
Looks like you are using a regular expression...
Looks like you are using a regular expression with grep. (if ^ is part of data, escape the character )
Try using egrep and with quotes

SIZE_SCR=`egrep '^scr' /rsi/logs/csc_summary_size_check.log...
1,785
Posted By grep_me
Thanks Corona688. Actually they do need all...
Thanks Corona688.
Actually they do need all the files. In addition they need random sample files worth 100MB for their review (or whatever). I have to zip these 100MB files and put it on the server...
1,785
Posted By grep_me
Take 100MB worth files from 200,000 Files
Hi,
I have a process which creates almost 200K files. Each file ranging from 1kb to 5kb. This is almost 2GB of data in all files.
I have a requirement where the business needs only 100MB worth of...
5,172
Posted By grep_me
try this: This will remove all the spaces and...
try this: This will remove all the spaces and replace it with an underscore and then rename them

ls -1 "t_ "* | while read filename ; do flnm=`echo "$filename" | tr -s " " "_"`; cp "$filename"...
3,953
Posted By grep_me
Thanks. It worked using nawk. But I have a...
Thanks. It worked using nawk.
But I have a scenario where there can be spaces in the userid/name field.
Is there anyway I can include the whole word(s) to match the pattern.
example: the...
3,953
Posted By grep_me
Elixir, Your method did not work either. I got...
Elixir,
Your method did not work either. I got the same error.
Here is my uname o/p just in case:
SunOS c1dupep4 5.10 Generic_147440-25 sun4v sparc SUNW,SPARC-Enterprise-T5120
3,953
Posted By grep_me
Hi Pamu, Your code did not work for me. I ran...
Hi Pamu, Your code did not work for me. I ran your code from command prompt, and it gave me an error. (I executed your code using the same exact files above)

awk: syntax error near line 1
awk:...
3,953
Posted By grep_me
Move a block of lines to file if string found in the block.
I have a "main" file which has blocks of data for each user defined by tags BEGIN and END.

BEGIN
ID_NUM:24879
USER:abc123
HOW:47M
CMD1:xyz1
CMD2:arp2
STATE:active
PROCESS:id60
END
BEGIN...
4,628
Posted By grep_me
Here is one more way...probably quickest :-) ...
Here is one more way...probably quickest :-)
awk -F"/" '{print $NF}' file.txt
Showing results 1 to 25 of 46

 
All times are GMT -4. The time now is 07:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy