Re: OT: scripting help - can you check a string for starts with?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 8:48 PM -0500 12/18/07, James Pifer wrote:
>Need a bit of scripting help. I have a very small script with a case
>statement. The object of the case statement is derived from the
>dmidecode command to determine the type of machine it is, if possible.
>It works fine, but we're finding that a lot of the HP type machines
>respond with a model number plus other information. For example, we
>might get these two:
>
>HP Compaq dc7700 30GB6000
>HP Compaq dc7700 60GB6000
>
>Those are completely made up, the point being that we want to match on
>just "HP Compaq dc7700" and forget the rest.
 ...

case $printername in
    "HP Compaq dc7700"*) echo "found $printername" ;;
esac
-- 
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux