ADSM-L

Re: Need a quick help on a script.

2004-03-18 15:22:20
Subject: Re: Need a quick help on a script.
From: "VANDEMAN, MIKE (SBCSI)" <mv2371 AT SBC DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 18 Mar 2004 12:19:46 -0800
It's stupid that UNIX doesn't have a simple way of doing this! Try:

substring = `echo $variable | cut -c 1-2`
if [[ "$substring" = "LT" ]]; then
    ...

If someone knows a simpler way to do this, that is also easy to understand,
I would like to know about it!

Mike Vandeman
510-784-3172
UNIX SSS
>(888) 226-8649 - SSS Helpdesk
>


-----Original Message-----
From: MC Matt Cooper (2838) [mailto:Matt.Cooper AT AMGREETINGS DOT COM]
Sent: Wednesday, March 10, 2004 9:18 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Need a quick help on a script.


 Hello all,
       I am not that good at scripting so this  will be real easy to
someone.   IF anyone knows where I lookup all the scripting commands I
could go a lot further.  I am used to doing things like this in SAS on
the MF.....

I need  to inspect a variable (the node name) for the first 2 characters
= LT or the first 5 characters = CLELT to do the script line otherwise
don't do the sscript line.

something like, but just inspecting the first 2 or 5 characters of the
node name which is the $1 varaible
IF $1 = LT  then  def assoc executives executives-noon $1
IF $1 = CLELT then  def assoc executives executives-noon $1


any help would be greatly appreciated.
Matt





      I scripted the processes for adding new PC nodes to TSM.  It adds
the node and puts it in a backup schedule.  This works fine.  Now things
are differnent and they let me move all PC backups to nights.  Which
works great until you look at 50 or so  DIFFERENT laptops that go home
on occasion.  So what I do is I put a 1 a day limit on backups every
morning ( and take it off in the afternoon).  This lets all PCs try to
backup at night, but if they don't, try again at noon.  So I need my
script to put LAPTOPS  (node name starts with LT or CLELT) in 2 scripts.

<Prev in Thread] Current Thread [Next in Thread>