1827981 Members
2279 Online
109973 Solutions
New Discussion

Shell Var?

 
SOLVED
Go to solution
Oviwan
Honored Contributor

Shell Var?

Hi

What does this exactly mean:
[
\
....

is somewhere an overview or something else?

Regards
11 REPLIES 11
RAC_1
Honored Contributor

Re: Shell Var?

It is another way of putting if not construct.

I prefer if [xxxx];then
hjhdhd
fi
There is no substitute to HARDWORK
Peter Godron
Honored Contributor

Re: Shell Var?

Oviwan,
91 is the ascci value for [
93 is the ascii value for ]

man ascii ( look for 5b and 5d (hex for 91,93)
Muthukumar_5
Honored Contributor

Re: Shell Var?

&# used to handle an alphabet in ascii mode in scripting. It is an expert level scripting.

# cat /usr/share/lib/pub/ascii

will give letter and ascii value to it.

--
Muthu

Easy to suggest when don't know about the problem!
Oviwan
Honored Contributor

Re: Shell Var?

Thanks!

But what is the reason for using the ascii method? is this environment dependently?

Regards
Muthukumar_5
Honored Contributor

Re: Shell Var?

Not like that. You can use ascii mode as well in shell.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=143878

See in that, netconf file is configured with [ and \ instead of [] for shell variables.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Shell Var?

See this:

Give [ in forums search in the top. It is changed to [ alphabet. Like the shell will interpret.

--
Muthu
Easy to suggest when don't know about the problem!
Peter Godron
Honored Contributor

Re: Shell Var?

Oviwan,
I have not come across a situation were I HAD to use the ascii equivalence codes.
I assume it is down to personal preference.
Oviwan
Honored Contributor

Re: Shell Var?

Thanks,

at first glance it's really confusing. Isn't there really an other reason?

Regards
Arunvijai_4
Honored Contributor

Re: Shell Var?

Hi,

Check this thread out

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=22050

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
James R. Ferguson
Acclaimed Contributor
Solution

Re: Shell Var?

Hi Oviwan:

This is an old bug introducted into the Forum database during one of its upgrades. The notation should render as open and close square brackets, respectively.

See Stuart Browne's post at Sep 22, 2003 06:25:13 GMT and Dan Gazzaniga's comments at Sep 26, 2003 17:34:02 GMT in this post:

http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=/cm/QuestionAnswer/1,,0xb27041de970ce3438b2622f343b29fbc,00.html&admit=716493758+1066396007828+28353475

Regards!

...JRF...
Oviwan
Honored Contributor

Re: Shell Var?

hehe, thanks, now it's all clear ;)