bash - How to add in shell script? -


assume let value of variable 42,

b=18+$a value of b should 60 

but i'm not getting value 60. instead it's printing 18+42. how can ?

new query :

grep -f "$name" -a1000 filename | sed -n '1p;19p;24p' 

assume let a=10,b=20,c=30.in above grep command can use '$ap;$bp;$cp' instead of '1p;19p;24p' ?

another thing, i've given -a1000. implies starting 1p considers till 1000 line , right ? need search throughout file without giving number. ho

bash:

b=$((18+a)) echo "value of b $b" 

or

let b=18+a echo "value of b $b" 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -