Storage Software
1754180 Members
3087 Online
108811 Solutions
New Discussion юеВ

Re: SSSU shell scripting

 
SOLVED
Go to solution
Lan_4
Advisor

SSSU shell scripting

I am making a shell script run sssu.
The script looks like this:
SNAP=...
HOST=...
sssu <select manager ... username=administrator password=administrator
select cell ...
add lun 3 vdisk="$SNAP" host="\Hosts\${HOST}"
exit
EOF

I am having troule with those "\" in the name
of host. Is there a better way to preserve the
real meaning of "\", don't try it as a special
character.

Thanks.

Lan

 

 

P.S. This thread has been moved from Disk array to HP Storage System Scripting Utility (SSSU). - Hp Forum MOderator

5 REPLIES 5
Tom O'Toole
Respected Contributor
Solution

Re: SSSU shell scripting

Yes, isn't it great that they designed it that way? Can you escape the \ using \\ in the symbol assign?
Can you imagine if we used PCs to manage our enterprise systems? ... oops.
Lan_4
Advisor

Re: SSSU shell scripting

Tried.
like, host="\\Hosts\\${HOST}"
It did not work.
Thanks.
Bob_Vance
Esteemed Contributor

Re: SSSU shell scripting

One problem with your original is that the \$ prevents ${HOST} from being evaluated.

Did you try:
(notice the 2 \\ before $)

HOST=yoyo
SNAP=vol1
cat <select manager ... username=administrator password=administrator
select cell ...
add lun 3 vdisk="$SNAP" host="\Hosts\\${HOST}"
exit
EOF

which produces:

select manager ... username=administrator password=administrator
select cell ...
add lun 3 vdisk="vol1" host="\Hosts\yoyo"
exit


I had to use 'cat' because I don't have access to SSSU right now.

hth
bv
"The lyf so short, the craft so long to lerne." - Chaucer
Lan_4
Advisor

Re: SSSU shell scripting

The trick for "\\" worked for most of cases, but not with the hostname starting with
"n", "t", "a", "f", because
"\n","\t","\a","\f" are escape characters.
It happened that I have two hosts with names
starting with "a" and "f". I guess the solution
is to "hard coded" them into the script.

Thanks to all.

Lan
Lan_4
Advisor

Re: SSSU shell scripting

Thanks.