1753559 Members
5858 Online
108796 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"