Search Results

Search: Posts Made By: somersetdan
1,317
Posted By Ygor
Oh I see the problem. $1 and $2 are local to...
Oh I see the problem. $1 and $2 are local to functions but you are not passing parameters to the function. Perhaps define a and b outside of the functions, e.g...$ cat sh.1
menu ()
{
echo...
835
Posted By guruprasadpr
Hi Just initialize the sum variable: ...
Hi

Just initialize the sum variable:

a=$1
count=1
sum=0

until [ $sum -ge 30 ]
do
sum=`expr $a \* $count`
echo " $1 * $count = $sum"
let count=count+1
done

Guru.
835
Posted By guruprasadpr
Hi a=$1 count=1 until...
Hi


a=$1
count=1


until [ $sum -ge 30 ]
do
sum=`expr $a \* $count`
echo " $1 * $count = $sum"
let count=count+1
done

Guru.
1,062
Posted By mirni
I think what you want is: sed '/dan/...
I think what you want is:
sed '/dan/ s/1000/1500/'

This will do the substitution only on the lines that match 'dan'.
Note that if a line contains "Maydan" or something, it will change this...
1,062
Posted By bakunin
First: if your input file and output file are the...
First: if your input file and output file are the same than sed will destroy the file. Use a different file for output.

Second: have a look at the man page for sed, about line ranges. You also...
1,062
Posted By 47shailesh
Can you pls post some input that support your...
Can you pls post some input that support your requirement and desired output.
1,923
Posted By zaxxon
Try backticks: a=`cut -f2 money` or this: ...
Try backticks:
a=`cut -f2 money`
or this:
a=$(cut -f2 money)

If the result of the cut is more than 1 value, you want to surround both lines of code with doubel quotes like:
a="$(cut -f2 money)"
Showing results 1 to 7 of 7

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