Operating System - HP-UX
1838727 Members
6488 Online
110129 Solutions
New Discussion

hello i have e shell script problem

 
SOLVED
Go to solution
jimmy_39
Advisor

hello i have e shell script problem

What is a " [ or ] "

Help me
12 REPLIES 12
Doug O'Leary
Honored Contributor

Re: hello i have e shell script problem

Hey;

Some context might be helpful...

I've seen things like that in html docs.. not normally in shells - at least not with functional terminals.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Elias Abboud
Honored Contributor

Re: hello i have e shell script problem

hi

where do you see these? Is your TERM variable set correctly? where did you get your shell script from??

Cheers
Elias
If you can't solve it, post it :)
jimmy_39
Advisor

Re: hello i have e shell script problem

echo "^[&f0k${#hn}D$hn^M\c"
elif [ "$TERM" = "xterm" -o "$TERM" = "vt100" ]
then
echo "\033]2;$hn\007\c"
elif [ "$TERM" = "dtterm" -o "$TERM" = "vt220" ]
Patrick Wallek
Honored Contributor

Re: hello i have e shell script problem

I think what you are seeing is cut-and-paste issues with the forums.

The forums seem to not like it if you paste something from MS Word. Characters get translated to their ASCII values for some reason.

If you did get the script from the Forums, it would be helpful to know which thread. Then maybe we can help you get it corrected.
Stephen Keane
Honored Contributor

Re: hello i have e shell script problem

[ = [

] = ]

Gopi Sekar
Honored Contributor

Re: hello i have e shell script problem


alright, the problem is actually with that post itself.

it should have been something like this:

if [ $TERM = hp -o $TERM = dterm ];
then
fi

so replace &=93 with [ and &=91 with ]

it could be because of problem with cut and paste

Regards,
Gopi
Never Never Never Giveup
Gopi Sekar
Honored Contributor

Re: hello i have e shell script problem


i'm sorry, actually &=91; is [ and &=93; is ]

typo error.
Never Never Never Giveup
jimmy_39
Advisor

Re: hello i have e shell script problem



delays[x]="Delay?"
done
unset delays[*]
}

while (( x < $strg_len )) && (( $strg_len < 1024 ))
do
(( x = x + 1 ))
scroll[x]=`echo "$*" |cut -c $x`
[ ${scroll[x]} ] 2> /dev/null && {
print "${scroll[x]}\c"
delay 2000
} || {
print "${scroll[x]}\c"
delay 5000
jimmy_39
Advisor

Re: hello i have e shell script problem

delays[x]="Delay?"



delays[;x];="Delay?"
Fred Ruffet
Honored Contributor
Solution

Re: hello i have e shell script problem

; seem to be part of the code.
[ is [

So script you give should look like :

delays[x]="Delay?"
done
unset delays[*]
}

while (( x < $strg_len )) && (( $strg_len < 1024 ))
do
(( x = x + 1 ))
scroll[x]=`echo "$*" |cut -c $x`
[ ${scroll[x]} ] 2> /dev/null && {
print "${scroll[x]}\c"
delay 2000
} || {
print "${scroll[x]}\c"
delay 5000


Doesn't it look nice ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
jimmy_39
Advisor

Re: hello i have e shell script problem

thanks