10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
2. Shell Programming and Scripting
I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as
name1:name2:name3:1
when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies
3. Shell Programming and Scripting
Hi
actually what happen i have taken a value from database table and stored in variable and that value is 20100601 000000 but this value is stored as string value in database table so
after storing this value in variable a when i did operation on this a variable like
a=`expr ${a} +1`
i m... (1 Reply)
Discussion started by: aishsimplesweet
1 Replies
4. Shell Programming and Scripting
My question is so simple:
A = raw_input("A ")
if A == '56':
VAR = (A + 54)/13
else:
print "other operations"
if I write in input 5656565656
i want to make some arithmetic operations if the first input is 56XXX
but the output is
TypeError: cannot concatenate 'str' and... (2 Replies)
Discussion started by: kazikamuntu
2 Replies
5. Shell Programming and Scripting
Hi there, I have some user input in a variable called $VAR, and i need to ensure that the string is 5 or less characters .... does anybody know how i can count the characters in the variables ?
any help would be great, cheers (2 Replies)
Discussion started by: rethink
2 Replies
6. UNIX for Dummies Questions & Answers
Hey I want to know if there is an option to know the number of lines containing a certain string (bit for example) in a file? Say I want to know number of lines containing only the string BIT in file xyz. I know how to get number of lines in a file by using wc -l but how do you get number of lines... (1 Reply)
Discussion started by: #moveon
1 Replies
7. Shell Programming and Scripting
Hi everyone,
I have a string as follow
ts1n65ulpa4096x16m16_130a_ss1p08v125c
i would like to extract 4096 and 16 from string and save it into two variable. but this string could also have the form
ts1n65ulpa32x16m16_130a_ss1p08v125c
therefore the number before "x" could be 2 or 3 digits. i use... (6 Replies)
Discussion started by: ROOZ
6 Replies
8. Shell Programming and Scripting
I have a variable (say $A) and while passing it gets either a number or some other string. Now how can test (with if else) whether the variable is just a ne or something else ?
Thanks a lot to all in advance
C Saha (2 Replies)
Discussion started by: csaha
2 Replies
9. Shell Programming and Scripting
In the following script when I get SIZE1 and SIZE2, they are of type string. I can not do any mathematical operations on them. I wanted to find out if I can convert string in to Number. Thanks in Advance.
FILE1='/export/registry/incoming/reg.dmp'
FILE2='/export/registry/reg.dmp'
SIZE1=`ls... (2 Replies)
Discussion started by: George_king
2 Replies
10. Shell Programming and Scripting
Hello
Does the unix korn shell provide a function to convert between number and string data-types
regards
Hrishy (1 Reply)
Discussion started by: xiamin
1 Replies