Current location: Hot Scripts Forums » Programming Languages » Other Languages » Linux Shell Script on DNS-323


Linux Shell Script on DNS-323

Reply
  #1 (permalink)  
Old 12-22-09, 12:29 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
Linux Shell Script on DNS-323

I'm new to linux and I'm creating a shell script to create a new repository on my DNS-323. It does not have bash. So far it's all good except the search and replace part. Can anyone tell me what I did wrong.

The part :-
sed "'s/REALMNAME/\$REALM/g'" svnserve.conf > $ALIAS/conf/svnserve.conf
Is not working for me. It doesn't replace. I've tried escaping the $REALM like \$REALM also won't work.

Code:
#!/ffp/bin/sh

echo Enter the full name of your project
read REALM
echo Enter the alias of your project only [_A-Za-z0-9] is allowed
read ALIAS

proceed() {
    echo "Your alias is '$ALIAS' and your realm is '$REALM'. Proceed? [Y|N]"
    read ANSW
}

create() {
    svnadmin create $ALIAS
    rm -r $ALIAS/conf
    mkdir $ALIAS/conf
    sed "'s/REALMNAME/\$REALM/g'" svnserve.conf > $ALIAS/conf/svnserve.conf
    clear
    echo "Your new repository :-"
    echo "svn://MY-NAS/$ALIAS"
}

proceed
if [ "$ANSW" = "Y" ]; then
    clear
    echo "Creating repository '$ALIAS'"
    create
elif [ "$ANSW" = "N" ]; then
    clear
    echo "Bye"
    proceed
else
    clear
    echo "Bad option"
    proceed
fi
__________________
Mr. Brown Eyes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-22-09, 02:28 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
Solved

I've solved this.

The correct syntax is :-
sed "s/REALMNAME/$REALM/g" $ALIAS/conf/svnserve.conf
__________________
Mr. Brown Eyes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM
help!! korn shell script gklt Script Requests 0 12-30-03 05:02 AM


All times are GMT -5. The time now is 09:13 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.