Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 31st May 2006, 19:37
tombstone tombstone is offline
Junior Member
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default bash script compare variables pattern matching

Fairly new to bash scripting and I'm having a hard time wrapping my head around this one.
Lets say I have 2 variables

user and db

how would I compare those 2 saying
if user=beginning of db(everything before the_) ;
code here
sometimes I'l have db be somethin_blah
and username will be 'something' (minus the last letter or letters) how would I do the same thing there

hope I was clear enough
help would be appreciated

Tommy two cups
Reply With Quote
Sponsored Links
Old 1st June 2006, 01:27
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts

Have a look here: http://www.tldp.org/LDP/abs/html/index.html and especially here: http://www.tldp.org/LDP/abs/html/tests.html
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: Assigning variables sjau Programming/Scripts 6 22nd May 2006 21:07
req: Bash / Script to auto kill PID if it's needed.... edge Programming/Scripts 8 14th March 2006 00:31

All times are GMT +2. The time now is 06:50.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.