hi
suppose we have a string str=hello
now suppose there is another variable str1=$str
now another variable str2.
how u will access 'hello' using str2?
hi
suppose we have a string str=hello
now suppose there is another variable str1=$str
now another variable str2.
how u will access 'hello' using str2?
what value you are assinging to str2?
str2=$str or str2=$str1
you mean like this:
str="Hello"
str1=$str
str2=$str1
echo str2
Not sure if this what you are looking for.
Actually there is a variable DIALPBIN=/dialp/Release/bin
i have a shell script test.sh
#!/bin/ksh
if [ "$1" = "" ];
then ## No parameters were entered
echo "Enter the fully qualified file name:"
read mInputValue
echo "the value is " $mInputValue
else
mInputValue=$1
echo "The file name entered was "$mInputValue
fi
if i entered $DIALPBIN in the command line argument like ./test.sh $DIALPBIN
then the result is :The file name entered was /dialp/Release/bin
but if i donot give the $DIALPBIN as argument, then message appears to enter fully qualified filename
then i enter $DIALPBIN
but in that case the result is :the value is $DIALPBIN.
i want that even if the command line argument is not given , the DIALPBIN should be interpreted as /dialp/Release/bin
plz help
i don't quite get the problem. that variable can still be interpreted in the script
var=$DIALPBIN
no its not geetting..
u try with $HOME instead of $DIALPBIN
and what u are getting
Try this...
#!/bin/ksh
if [ "$1" = "" ];
then ## No parameters were entered
echo "Enter the fully qualified file name:"
read mInputValue
echo "The value is `eval echo $mInputValue`"
else
mInputValue=$1
echo "The file name entered was "$mInputValue
fi