10 More Discussions You Might Find Interesting
1. Programming
Can C add its results into an array like bash? For example using bash:
cat /etc/passwd
**truncated for space **
gdm:x:109:118:Gnome Display Manager:/var/lib/gdm:/bin/false
mysql:x:110:122:MySQL Server,,,:/nonexistent:/bin/false
statd:x:111:65534::/var/lib/nfs:/bin/false... (5 Replies)
Discussion started by: metallica1973
5 Replies
2. Shell Programming and Scripting
Hi
I have a requirement of taking time as input variable outside the script.depending on the time it will check the file output .like
./script.sh <30 min>
so script.sh should run every 5 minutes ie.6 times to check the output file.Can any one please help here. (7 Replies)
Discussion started by: netdbaind
7 Replies
3. Shell Programming and Scripting
Hi,
I have a file abc.txt as
ABC,TYU,1.2566
AHG,GJJ,1.898
hgh,FGA,1.854
My program is reading each line and storing the values variables base_cy, quo_cy, ra_amt
Need to validate each of them as in:
base_cy and quo_cy should be a 3 character alphabet among A-Z, if it is lower case ... (1 Reply)
Discussion started by: infyanurag
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
i have a variable which holds a variety of letters. eg,
var=qwertyuiop
what i want to do is determine wether an inputed letter is already stored inside the variable, so i can say to enter a new one.
i have been playing around using tr and grep but nothing seems to work at all.
... (2 Replies)
Discussion started by: castillo
2 Replies
5. Shell Programming and Scripting
hi all,
i have a shell (ksh) script where i am reading line by line from a grep command and i wanted to check if the grep command actually returned something or was null. i can do this by using -z :
if ; then .....
but this forces me to do something when $myVariable is null when i... (3 Replies)
Discussion started by: cesarNZ
3 Replies
6. Shell Programming and Scripting
Does anyone know the quick way to check if the variable contains only numeric characters, for example:
A=123445 - correct
B=#f123* - incorrect
I am in ksh88i Thanks a lot for help -A (1 Reply)
Discussion started by: aoussenko
1 Replies
7. UNIX for Dummies Questions & Answers
How could I check if a numeric variable has 5 digits in KSH...I have a zipcode variable that I know will always be 5 digits, and I want to print out an error if it is less or more than 5 digits the problem is that I have it as:
if ]
but this won't work because the statement doesn't see 0001 as... (3 Replies)
Discussion started by: developncode
3 Replies
8. Shell Programming and Scripting
RH Linux, $SHELL=/bin/ksh
I have a .profile which I source in as such --> . .profile
Whats happening is the variables are getting validated and generating errors.
for example
.profile
export foo=/to/the/moon
when I . .profile , I get
: not foundmyusername/.profile
or bad... (8 Replies)
Discussion started by: BMetelsky
8 Replies
9. Shell Programming and Scripting
I'm using the following in my script.
if echo $cpuidle |/usr/bin/egrep ; then
when I issue this statement it issues the value of the variable back to stdout which ends up in my output file.
Is there a better way to write this?
I'm using ksh on solaris 9. (3 Replies)
Discussion started by: MizzGail
3 Replies
10. Shell Programming and Scripting
how can i check that a variable is between 0-100, like if i ask a user to input a number between 1-100 and i want to excute commands WHILE that number is between that range or else i will keep asking the user to make another input
here's what i got
#!/bin/bash
echo "Guess my secret number... (2 Replies)
Discussion started by: Poison Ivy
2 Replies