10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to execute something like this
file=/tmp/test.txt
firstline=$(head -n 1 $file)
value=`echo $firstline | cut -d'=' -f2`
if
then
echo true
fi
i read the first line of a file, cut to the numeric value in the first line and check if it greater than 2
but for some... (11 Replies)
Discussion started by: madhan_dc
11 Replies
2. 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
3. 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
4. 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
5. Solaris
hello,
i am writing a script that takes the UID from the PASSWD and then i want
to increse the Number by one. for the Next user.
i cannot get this to work that a variable is as interger
example:
set i = 0
set $i = $+1
it's in tcsh if it's mather (10 Replies)
Discussion started by: shatztal
10 Replies
6. 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
7. Shell Programming and Scripting
Hi,
I am trying to use a regular exp to match any number between 0 and 7 except 2......
I am using:
echo $myvar | egrep "{1}{1}"
Which isnt working....
Please can someone help?
Thanks
yonderboy (10 Replies)
Discussion started by: yonderboy
10 Replies
8. Shell Programming and Scripting
Hi,
/etc/fstab file contains:
==================
cluster_root#root / advfs rw 0 1
cluster_usr#usr /usr advfs rw 0 2
cluster_var#var /var advfs rw 0 2
/proc /proc procfs rw 0 0
t_d#t_f /t_m advfs rw 0 2
/dev/disk/dsk1c /ufs_mnt ufs ... (3 Replies)
Discussion started by: mansa
3 Replies
9. UNIX for Dummies Questions & Answers
I have search the forum for an easier way to write this code. I have two separate 'if' to do this and it works but am wondering if someone knows a quick way to combine them. I want anything between 1 and 100 but not '01' or '005', '0010', etc.
if ) ]] ||
]; then
echo "Try... (3 Replies)
Discussion started by: giannicello
3 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