Search Results

Search: Posts Made By: sivasenthil_k
4,217
Posted By sivasenthil_k
Hi I have put some simple logic in place to...
Hi

I have put some simple logic in place to do the trick for me , the code now looks like

read variable
length=${#variable}
y=`expr $variable + 1`
length1=${#y}
if [ $length1 != $length ]...
4,217
Posted By sivasenthil_k
Hi Thanks I posted in the wrong group...
Hi

Thanks

I posted in the wrong group by mistake , Sorry about that

Regarding my query

I don't know what would be the length of the input string , actually 00123 would be the input from...
4,217
Posted By sivasenthil_k
Addition with the prefixing zeros included
Hi

I need to do an add function but it should include the prefixed zeros

For Example
i=00123
j=`expr $i + 1`

The output it shows is 124 but I want the output to be 00124

Could any one...
3,592
Posted By sivasenthil_k
Thanks Anubu It works fine now
Thanks Anubu

It works fine now
3,592
Posted By sivasenthil_k
if statement to match *
Hi

I have a script like

read i
if [ $i -eq "*" ]
then
echo bingo
fi

I want to enter the if block if i is equal to *
The same doesn't happen , when I input * the script fails with...
2,181
Posted By sivasenthil_k
Hi Thanks for the responce But I got...
Hi

Thanks for the responce

But I got to know the "here document" function which could solve my problem

The code looks like

inter << END
1
END

The output is

inter
1.enter 1...
2,181
Posted By sivasenthil_k
Hi Thanks for the reply running it...
Hi

Thanks for the reply

running it periodically is not a problem for me but my query is about making the script interactive

Thanks..Siva
2,181
Posted By sivasenthil_k
Making Interactive program
Hi Friends

I am trying to make an interactive shell script ( I do not have expect tool )

My objective is

1.I have a progam named say "inter"
The program when ran on command prompt will be...
10,811
Posted By sivasenthil_k
Hi .. I got a script using hold and get for...
Hi ..

I got a script using hold and get for the original block search I had requested ..

it is

sed -e '
/^BEGIN$/,/^END$/!d
/^END$/!{H;/^BEGIN$/h;d;}
H;g;/xxx/!d
' temp1

it works fine...
10,811
Posted By sivasenthil_k
Thanks Vino ..
Thanks Vino ..
10,811
Posted By sivasenthil_k
Hi Vino Thanks for the reply Example is...
Hi Vino

Thanks for the reply

Example is ..

Say I need the blocks with xxx and yyy in the file below ( I need the first and last blocks to be in the output .. which has xxx and yyy )

BEGIN...
10,811
Posted By sivasenthil_k
Thanks Vino It works .. But what if I...
Thanks Vino

It works ..

But what if I need the block with two patterns in it ..( the order of occurence of the pattern is not known ..

Could you help me do this using hold and get options in...
10,811
Posted By sivasenthil_k
sed h and g options
Yes I tested it myself ..

My objective is to take the block which has only xxx in it

But it gives output like

BEGIN
sdfdsf
sdfsdf
xxx
xxx
END
BEGIN
sdfdsf
sdfsdf
END

.. I am...
10,811
Posted By sivasenthil_k
sed h and g options
Hi ..

Happy New Year..

If i do a

sed -e '
/BEGIN/,/END/{
h
/xxx/{
g
p
}
}
' temp1

I have two queries in this script

1.Will the block between BEGIN and END be stored in the...
Showing results 1 to 14 of 14

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