10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I have a variable which read the value from the lines, and if it is empty string (5 bytes), then I have to assign this variable to zero "0", it able to detect the data is empty by showing me the message "empty", but not able to assign it as zero.
WTHP=`echo "$file" | cut -c158-162`
if ]... (5 Replies)
Discussion started by: newbie2011
5 Replies
2. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I have the following data set:
TRAIT DOSE
40 0.4
30 0.3
95 1.2
120 1.7
85 1.4
136 1.8
134 1.8
40 0.4
30 0.3
95 1.2
120 1.7
85 1.4
136 1.8
134 1.8
40 0.4
30 0.3
95 1.2 (2 Replies)
Discussion started by: wolf_blue
2 Replies
4. Shell Programming and Scripting
I haven't checked any installation script to see how this is done..
But I could not even do following simple task.
How do I Change existing variable value only when user enteres non-empty string. ?
#!/usr/bin/ksh
uid="scott"
# Assign new value user enters to uid, else leave it... (7 Replies)
Discussion started by: kchinnam
7 Replies
5. Shell Programming and Scripting
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies
6. Shell Programming and Scripting
Hi, Sorry for the dumb question but I can't seem to figure this one out. I want to write an if condition that basically checks if my variable is in a file. So far I have the following:
if ]
then
do something
else
do something else
fi
So essentially if the grep returns something then... (3 Replies)
Discussion started by: eltinator
3 Replies
7. UNIX for Advanced & Expert Users
Hi,
I have a text file in which , I have contents like
t1=abc
t2=xyz
t3=awe
......
I am able to read contents of these variables in a script by
. /temp.txt
echo $t1
Now, what my requirement is something like this
a="t"
i=1
echo $a$i --->this is displaying t1 (3 Replies)
Discussion started by: kaaakrishna
3 Replies
8. UNIX for Advanced & Expert Users
Hi everyone,
I do have the requirement to store the value of below result in a variable
eval echo $a
Please .... Help me , it's urgent to my sript
Thanks in advance... (1 Reply)
Discussion started by: kaaakrishna
1 Replies
9. Shell Programming and Scripting
Hi All,
I need urgent help. Because just now i have to give this code to my client.
I have a folder name is Testing. this Testing folder contains the following 3 files.
1.txt
2.txt
2.txt
Now I want to store the first value of my folder in a variable say suppose $a.
Means i want that... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies
10. Shell Programming and Scripting
I am extracting directory path from file which is stored in a variable.
while read inputline
do
script_name=`echo $inputline | cut -d' ' -f2`
cd $script_name
done < path_scripts.txt
where as path_scripts contains
input_process.bash ~/jobs/process/input/bin
The script output says... (1 Reply)
Discussion started by: jacksam007
1 Replies