Advertisement

07.16.2008 at 04:55PM PDT, ID: 23571713
[x]
Attachment Details

Using the read function in a bash script problem

Asked by Simon336697 in Bourne-Again Shell (bash), Shell Scripting

Hi guys hope you can help.

Ive got the following code snippet that is not working when using the read function.

echo -n "Enter the menu1 parent folder name that this menu2 file will reside in. This is used to create the extraction file.";
 /bin/echo;
read parent;
cd /var/www/html/simeswiki/templates;
cp extract_menu_files_menu2to4_x_from_db.php /var/www/html/simeswiki/includes/extract_menu_files_menu2to4_$parent_from_db.php;
dir /var/www/html/simeswiki/includes/extract_menu_files_menu2to4_$parent_from_db.php;;

Problem:
/var/www/html/simeswiki/includes/extract_menu_files_menu2to4_.php

Notice in the above that the $parent part is being shaved off...it is not being displayed.

Any help greatly appreciated.

Start Free Trial
[+][-]07.16.2008 at 05:14PM PDT, ID: 22021377

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Bourne-Again Shell (bash), Shell Scripting
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.16.2008 at 11:05PM PDT, ID: 22022659

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628