10 More Discussions You Might Find Interesting
1. Linux
Hi all,
I used to set variable by read from keyboard
read -p 'Input new value for variable :' var
Now I want to pipe from ls and set to var
a.txt b.txt c.txt
ls | grep a.txt | read var
why this cannot set the $var.
What is the different between them....:wall: (4 Replies)
Discussion started by: mainsun
4 Replies
2. Shell Programming and Scripting
greetings,
i have a variable $input that i want to use to set $output. $input is /dir/filename.mph and $input is passed to my script that i manipulate it as follows:
input=`basename $input`i want the $output to be filename_solved.mph, basically stuffing "_solved" in the filename. here's how i... (2 Replies)
Discussion started by: crimso
2 Replies
3. HP-UX
Hi,
I am using hp unix
i want to know the use of the following commands
set --
set - variable
thanks (4 Replies)
Discussion started by: gomathi
4 Replies
4. Shell Programming and Scripting
Hi everybody. I am finishing this program but there is just one detail.
I need to define the number of files that have to be deleted in this way MAXFILES=3 ./program 1 2 3 4 if the $# is > MAXFILES then confirm otherwise just delete them. But if i don't define the MAXFILES like ... (1 Reply)
Discussion started by: bartsimpsong
1 Replies
5. Shell Programming and Scripting
Hi,
I am new to UNIX. I wonder how to set value to variable in UNIX..
my code:
if ; then EXIST=$a ; else EXIST=$b ; fi'
echo $EXIST
the value of EXIST is empty...
Thanks :) (5 Replies)
Discussion started by: suigion
5 Replies
6. Solaris
I am working with solaris 9 sunBlade150 Box.
I Installed a program, need to set the environment variable so that when the executable is entered,it finds the path to the executable.
The documentation for the software says: Set the appropriate environment variable:
Connect to server failed;... (8 Replies)
Discussion started by: smartgupta
8 Replies
7. Shell Programming and Scripting
In ksh I thought a global variable was any variable in a script or function that did not have the typeset command. I have a global in my calling script which I increment in a function, but the value does not change in the calling script. Here is the code:
function f_open_log
{
typeset -r... (5 Replies)
Discussion started by: robotball
5 Replies
8. Shell Programming and Scripting
okay, this shouldn't be difficult but I can't figure it out. How can I set a variable with another variable. I have the following:
foreach pe ($dir $sp)
set tpe = `echo $pe | grep M`
if ($tpe == M) then
set ${$pe} = M <--- This doesn't work
else
endif
end
In this case what... (2 Replies)
Discussion started by: wxornot
2 Replies
9. UNIX for Dummies Questions & Answers
I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so:
set -a
export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data"
export... (2 Replies)
Discussion started by: ParNone
2 Replies
10. Programming
Hello all,
I'm going to be using some of the date functions from time.h to do some time stamping. I will be getting a time and date from the header of a TIFF file. I will need to be able create a time for each time zone in the U.S. The source of the time stamp will be in GMT. What I'd like to do... (2 Replies)
Discussion started by: shldBcding
2 Replies