10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Input:
XXX:1,XXX:3,XXX:3
Output:
A=1
B=3
C=3
Below code is what i do currently. However it doesn't work out for all cases. As some times the last digit extracted is giving me error. It cant be used for arithmetic computation.
Any better methods out there? If possible, can you... (9 Replies)
Discussion started by: bananamen
9 Replies
2. Shell Programming and Scripting
Hi I am beginner in writing shell scripting please tell me how to compare a string in Unix shell.
i have two variables in a shell script,
var1="00101 00201 00301 303 401 405"
var2="101 201 301"
i want to compare var1 with var2 . for example if 101 from Var1 present in Var2 or not. similarly... (5 Replies)
Discussion started by: nikesh29
5 Replies
3. Shell Programming and Scripting
Using below command
awk 'NR==FNR{A=$1;next}
{sum+=($2*A)}END{OFMT="%20f";print int(sum)}' Market.txt Product.txt
answer:351770174.00000
how to convert this to 351770174.
when i try with below command i am getting different result.
awk 'NR==FNR{A=$1;next}... (3 Replies)
Discussion started by: katakamvivek
3 Replies
4. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
5. Programming
how can i send an integer via message queue?
i try this, but it doesn't work, child process receive 13345943 instead of 5
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/msg.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>
#include <unistd.h>... (2 Replies)
Discussion started by: tafazzi87
2 Replies
6. Shell Programming and Scripting
Hi
What is the difference between following commands
Command1
length=1
if ] ; then
echo "Hellow world"
fi
Command 2
length=1
if ] ; then
echo "Hellow world"
fi
which is correct usage from this (2 Replies)
Discussion started by: morbid_angel
2 Replies
7. UNIX for Dummies Questions & Answers
I'm trying to write a programme which scans strings to find how many vowels they contain. I get an error saying that I'm trying to compare a pointer and an integer inif(*v == scanme){. How can I overcome this ? Also, the programme seems to scan only the first word of a string e.g.: if I type "abc... (1 Reply)
Discussion started by: fakuse
1 Replies
8. Programming
Hi guys :D
I am still playing with my C handbook and yes, as you can see I have small problem as always :cool:
I wrote a C code
#include <stdio.h> #define MESSAGE 100 int main(void) { char input_mes - Pastebin.com
And when I try to compile it I get following errors from gcc
... (1 Reply)
Discussion started by: solaris_user
1 Replies
9. Shell Programming and Scripting
Hi,
I am just trying to compare integer in ksh. can you please tell me what's wrong with this code... or give me suggestions on alternative.
sample code:
i=0;
if ; then
echo inside if
fi
Thanks in advance! (6 Replies)
Discussion started by: nram_krishna@ya
6 Replies
10. Programming
I received a warning when I tried to compile my program that said:
warning: comparison between pointer and integer
Could you please explain to me what this means, and in what ways I could possibly fix this?
Thanks for your help! (2 Replies)
Discussion started by: sjung10
2 Replies