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)
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)
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)
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)
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)
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)
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)
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)
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)