Search Results

Search: Posts Made By: amicon007
15,384
Posted By amicon007
Yes.. Well I was able to do through sed by...
Yes.. Well I was able to do through sed by replacing the spaces in the string with \n and then applying the search pattern. Thanks for the help.
15,384
Posted By amicon007
Sed filter words from string
I have following string in a variable:

str="sstring garbage adfsdf tab.col1 lkad rjfj tab2.col2 adja tab2.col4 garbage"

I want to filter "word.word" pattern from it. I assume the pattern won't...
4,023
Posted By amicon007
It does recognize: There seems some...
It does recognize:


There seems some difference with handling of binary character between my sed and cut.
4,023
Posted By amicon007
I am having the difference: I have SunOS
I am having the difference:


I have SunOS
4,023
Posted By amicon007
Just try stripping off first 2 characters using...
Just try stripping off first 2 characters using sed and using cut. Check the difference in the results.
4,023
Posted By amicon007
Well, I have the file of GBs size and sed works...
Well, I have the file of GBs size and sed works 5-6 times faster than cut. Strangely just tried stripping 1 char:


and it worked same as stripping 2 chars using cut.

Any logic in this?
4,023
Posted By amicon007
Open it in 'vi'. ---------- Post updated at...
Open it in 'vi'.

---------- Post updated at 06:24 AM ---------- Previous update was at 06:10 AM ----------

may be sed takes them as one binary char. Checking...
4,023
Posted By amicon007
sed and cut behaving differently
I have attached a file with few records. First 2 characters of each record are binary characters. I can remove it by



and it works fine. But



is behaving differently and removing more...
3,316
Posted By amicon007
sed -e 's/CREATE TYPE \([^ ]*\).*/DROP TYPE \1...
sed -e 's/CREATE TYPE \([^ ]*\).*/DROP TYPE \1 FORCE;\n&/' -e 's/CREATE OR REPLACE TYPE \([^ ]*\).*/DROP TYPE \1 FORCE;\n&/' test.sql
68,589
Posted By amicon007
sed -e "2,$ s/,/','/g" -e "2,$ s/\(.*\)/'\1'/"...
sed -e "2,$ s/,/','/g" -e "2,$ s/\(.*\)/'\1'/" testfile


sed -e "2,$ s/,/','/g" testfile | sed " s/\(.*\)/'\1'/"
4,257
Posted By amicon007
Well I used the following in a script far long...
Well I used the following in a script far long back on ksh; if I remember

{
unix2dos -437 file1 | uuencode file1 file1;
unix2dos -437 file2 | uuencode file2 file2;
} | mailx -s "Files"...
4,257
Posted By amicon007
Who me?? If yes, right now I cant as sendmail is...
Who me?? If yes, right now I cant as sendmail is not configured at this moment
4,257
Posted By amicon007
This should work I guess..... (echo " The...
This should work I guess.....

(echo " The first file ";uuencode file1 file1; echo " The sec file ";uuencode file2 file2) | mailx -s " The files " venkidhadha@in.com
16,792
Posted By amicon007
Thumbs up...
Thumbs up...
16,792
Posted By amicon007
print as well as count the files found by find command
I want the output of the find command to be printed and also the total files found by it. Can someone help in this.

Obviously $ find . -type f | wc -l will not output the files found but only...
1,885
Posted By amicon007
Query regarding grep
In what cases the following command ignores lines in input file:

$ grep -c "^" inputfile
2,196
Posted By amicon007
"where the no of lines containing "<branch value=...
"where the no of lines containing "<branch value= " is increasing " Means??

Can you provide with the expected output of the input you provided.??
Is below what u expect??

$ cat inphtml | sed...
3,759
Posted By amicon007
Problem with parsing filenames containing spaces
I tried using the following options to parse the *.sh files in a dir
(the name can contain spaces). But each of them breaks:

FILESSH=$(ls /mysh/*.sh)

echo "$FILESSH" | while read FILE ; do ...
5,251
Posted By amicon007
FILESSH=$(ls /mysh/*.sh) --- FILESH being used...
FILESSH=$(ls /mysh/*.sh)
--- FILESH being used here for some other task ---
echo "$FILESSH" | while read FILE

This does not break for leading or traing whitespaces for me...

for FILE in...
1,845
Posted By amicon007
An awk version: awk ' BEGIN { ...
An awk version:

awk '

BEGIN {

word=""
num=""

}

{
if ( NR==1 )
{
word=$1;
num=$2;
}
else {

if ($1 ==...
4,145
Posted By amicon007
cat file_having_java_strings | while read str ...
cat file_having_java_strings | while read str
do
var1=${str##* } #will contain number part of the error string
var2=${str% *} # will contain the text part of the error string
echo "$var1"...
5,251
Posted By amicon007
Moving filenames containing spaces
I want to ftp all the sh files in the directory. Also if any of the file name
contains spaces in them, it should be converted to underscores before it is ftped. I wrote the following code below:
...
2,557
Posted By amicon007
Retaining default OFS
Hi,

I wat to remove the first two columns of the ls -l command:

$ ls -l | awk '{ $1="";$2="";print;}'

The only problem is now the columns of the output is space separated instead of the...
2,248
Posted By amicon007
Problem with rm
strSpoolFile="/batch/job/temp/acdd223_weeklyReport.txt"
FAILURE=16

[[ -f ${strSpoolFile} ]] && {
rm ${strSpoolFile} || (( intRetCd = FAILURE ))
}


Is there any possible case the...
7,801
Posted By amicon007
Thanks.. works welll...
Thanks.. works welll...
Showing results 1 to 25 of 28

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