Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-22-2003, 12:15 AM   #1
Registered: Sep 2003
Distribution: *bsd, solaris, gentoo
Posts: 86

Rep: Reputation: 15
Question help on web folder script

I writing a script that creates a webfolder , set permissons, ownership and copies a sample index, for user that are requesting web space on my server. For some reason the if statment in my script doesnt seem to work properly, here 's what i got
# webspace creater tool built by seejay@n3tlab

choice=" "
#intro for user
echo With your existing shell account you can create a web page you can access threw your account, but you must know html in order to use this feature, are you sure you want to create a web account ? yes or no
read choice

# if user says yes there dir is created in the web folder
if [$choice="yes"]
mkdir /var/www/html/freespace/$me/
echo your web folder is /var/www/html/freespace/$me/ and can be viewed at$me/
# set permissions and ownership
chown $me /var/www/html/freespace/$me
chmod 755 /var/www/html/freespace/$me
# copy sample index to web folder
cp /usr/bin/index.html /var/www/html/freespace/$me

#if user says no or anything else
echo your web folder will not be created, thanks for using n3tlab

# all done

The script will run but no matter what the user inputs the script outputs a error "

/usr/bin/webhosting: line 12: [yes=yes]: command not found
your web folder will not be created, thanks for using n3tlab
[seejay@localhost seejay]$ "

i think that it's not reconizing the if statment properly, can some one please help me?
Old 11-22-2003, 07:40 AM   #2
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
Your line 12:
if [$choice="yes"]
should be
if [ $choice = "yes" ]
Note the spaces!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, Adding New HD to Web Server HTML folder jtyler Linux - General 1 10-27-2005 09:59 AM
Directory index of web folder Swakoo Linux - Newbie 3 06-17-2005 04:28 AM
How can you get a list (names) of pictures from a web folder? Laser Devil Programming 5 06-11-2005 12:51 AM
WHere is my web folder on suse 9.0 Virtualhate Linux - Newbie 2 06-08-2004 12:28 AM
mount web folder? keithturner Linux - Newbie 8 01-24-2003 07:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration