10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi There,
var1=value1
var2=value2
var3=value3
for (( i=1; i<4; i++ ))
do
temp=var$i
echo "$temp"
done
OUTPUT
var1
var2
var3
I want the output to be
value1
value2 (5 Replies)
Discussion started by: jagpreetc
5 Replies
2. Shell Programming and Scripting
Hi,
I am trying to set a variable that has time the format desired. And my intention is to echo variable (instead of actual date command) everytime I like to echo date. Please take a look at below code.
$NOW=''
echo $NOW
After 5 minutes
$echo $NOW
Issue here is , I am not... (2 Replies)
Discussion started by: vinay4889
2 Replies
3. Shell Programming and Scripting
Hi,
I've been having trouble figuring out what the following read statement is doing.
DO I = 1, natom
k = 3 * (i - 1) + 1
READ(8,*) AtNum(I), (X_2(J),J=k,k+2)
END DO
The part I don't understand is:
(X_2(J),J=k,k+2)
the file it is reading is simply a set of... (8 Replies)
Discussion started by: butson
8 Replies
4. Shell Programming and Scripting
hello guys,
i am having the below piece of code
error
()
{
echo"Press y /n"
read ans
case $ans in
y) main;;
n) exit
esac
}
In the abve code, read statement is not working i.e not waiting for user to enter input.
,i tested exit status its 1.
could anyone help me to do this
... (11 Replies)
Discussion started by: mohanalakshmi
11 Replies
5. UNIX for Dummies Questions & Answers
hi,
this is my script #!/bin/ksh
cat temp_file.dat | while read line
do
read test
if ]; then
break
else echo "ERROR"
fi
done
when i execute this code , the script does wait for the user input . it directly prints "ERROR" and terminates after the no. of times as there... (3 Replies)
Discussion started by: siva1612
3 Replies
6. Shell Programming and Scripting
Hi
I am stucked in the below script .I want to input with yes/no from the user and then execute the code inside if but it is not working .I just need the logic as where I am wrong so that i can use the same in my work .
then
echo "Hi All"
fi
].
Please suugest . (4 Replies)
Discussion started by: mani_isha
4 Replies
7. Shell Programming and Scripting
Hi Guys..
need some urgent help... I am stuck in something badly
I need to write a script which would read a sql statement (which might be a join/inner join/select/sub select etc. )
I need to read that sql statement ... and in the output I want all the table names and columns (doesn't... (4 Replies)
Discussion started by: freakygs
4 Replies
8. Shell Programming and Scripting
Hi there
I want to ask to a user something about each line of a file. This is my code:
#cat test.txt
first line
second line
third line
#cat test.sh
#!/bin/ksh
read_write () {
echo "Do you want to print the line (YES/NO)?\n"
read TEST
case ${TEST} in
YES) return 0;;
... (3 Replies)
Discussion started by: tirkha
3 Replies
9. Shell Programming and Scripting
I have a script consisting of certain functions whose input is a file at same location. In that file i have written the name of anothe file at same location. The third file contains a word which act as a function in the first script.Let me give an example
i have a scrip file say 1.sh in which i am... (7 Replies)
Discussion started by: sumitdua
7 Replies
10. Shell Programming and Scripting
Hello all,
I have the below script and I'm a little stuck on the best way to continue.
Essentially I'm creating a text file (systems.txt) with a list of servers in it by hostname. Then I would like to echo a menu with each hostname and a number to use to pick it from the list. It's somehow... (7 Replies)
Discussion started by: sysera
7 Replies