I tried with the script as you suggested but I am not able to edit value for 2nd argument. Please see the output.
Enter Value : 12
Enter number: 1234
12
34
After change it to another condition as suggested by you... and the output was
Enter Value : 12
Enter number: 1234
12
12
...
Ok, the second condition you should try was wrong, should be
EDIT: I changed the variable names to those from the last posts in the following text:
The script (bash script, you have to change /usr/local/bin/bash to what it is on your machine), and I changed the prompt text for "VAL" for better understanding.
(My OS is FreeBSD and I have to use the flag "-e" to "expand" "\c").
I don't get it what you mean is not working, the output for me is:
If you only do <return> for "VAL" it should mean the default value from "SNO", in the last example "12". As I understand you this is what you want.
There is no possibility for you to edit the default value on the screen, the read command is reading from STDIN (which echoes to the screen), _not_ from the screen, so you can never reuse the printed default value from the screen, only reuse it in the script, like I (and others) described.
NB! this is how it works on FreeBSD as far as I know.
Ceiling Light - The Forgotten Element
One of the highest details concerning using an LED ceiling panel essentially offer a fantastic dance floor which definitely makes the customers dance right away.They are a quite low cost method of something like a lighting solution, simple collection up,... (1 Reply)
Need ideas on how to achieve the below.
We have a script say "profile.sh" which internally calls another existing script called "name.sh" which prompts for the
name and age of a person upon execution. When i run profile.sh how can i populate a pre-defined value from another file and pass that... (1 Reply)
Hi,
I need a shell script, which would search the result values from another files.
1)execute " select column1 from table_name" query on the table.
2)Based on the result, need to be grep from .wft files.
could please explain about this.Below is the way i am using.
#!/bin/sh... (4 Replies)
I am looking for an easy way to calculate the sum of three values (*-12, *-01, *-02) which are contained after a comma (,). I have found an awk command that will sum every 3rd value, but I am not interested in the values before the comma (,).
awk '{s+=$1}NR%3==0{print s;t+=s;s=0}'I am only... (8 Replies)
Hi:
I am trying to reuse an existing shell script foo1.csh to set environment variables inside a perl script and its childern processes.
Is it possible at all to make those environment variables persistent in the main perl process and its children processes?
Do I have to create a new... (4 Replies)
Hi All,
Am trying to write a shell script which will get values from an excel and do some calculations.
Can any one pls help me out in the commands used to get the values from ms-excel.
Thanks!!!:) (2 Replies)
only the arguments that are written to the file,
my script is (sh /u01app/wkf.sh"$start_no","$name","$Condition","$file_name") like that
when ever I run my script I need to write into a new file every time,
like wise I have upto10 files with different names.bec my $start_no and $name will... (1 Reply)
Hi ,
I am new to linux and also also to shell scripting.
I have one shell script which unpacks .tgz file and install software on machine.
When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Values of value of x ($$X) in unix shell script
program
----------------
#!/bin/ksh
t1='/CPI/nodeA/stubs/Test/T1'
t2='/CPI/nodeA/stubs/Test/T2'
cd $$1--> Parameter may me t1 or t2
-------------------
expecting cd $t1 shold go to the path but it is giving error. (5 Replies)
I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process.
I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)