need help in concatenating

Hi All ,

i`m writing a script , i stucked in middle .

Script

echo "Please Enter the INSTANCE name"
read iName 
echo "The INSTANCE name is $iName"
 
more /opt/IBMIHS*/conf/httpd.conf_"$iName"

script end

here i`m getting error as :

Error

/opt/IBMIHS*/conf/httpd.conf_w101: not found

actually wen i`m doing it manually more is working but in script its not coming.

can any one explain me the reason why its not coming and how can i avoid that error??

thx in adv

Check for both the environment and shell (in script and manual).
May be you have "globbing" off?

$ set -o noglob
$ ls *
* not found
$ set +o noglob
$ ls *
1                            a.u                          d                            i                            

can u put how you are manually doing via more, just ensure to find was there any typo

You should also separate the variable name from the string with curly braces..

more /opt/IBMIHS*/conf/httpd.conf_"${iName}"

@michael

u rockzz man.. it working very well..

thanks a lot

thanks for the site also...

---------- Post updated at 05:49 PM ---------- Previous update was at 05:43 PM ----------

hey guys,

sry the prob is not resolved

i`m giving a part of my script

echo "Please Enter the INSTANCE name"
read iName
echo "The INSTANCE name is $iName";
Sname=`hostname`;
cat /opt/IBMIHS*/conf/httpd.conf_"${iName}" 
Error:
cat: /opt/IBMIHS*/conf/httpd.conf_wl03a: No such file or directory

wen i`m trying manually ,

supposed o/p :

$ cat httpd.conf_wl03
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
$ pwd
/opt/IBMIHS/conf
$

thanks in adv

Can't see the a in your source file...

@above ,

hey i checked nw , its der.. mi8 b i missed to update that . "a" is der also

@mod , gng fwd i`ll follow that format

Make sure that you do not leave any trailing space while you enter the value for iName. This could also be one of the reason..