* echo gives internal error with \n
@ 2007-06-17 11:13 adrian15
2007-07-22 13:27 ` Marco Gerards
0 siblings, 1 reply; 3+ messages in thread
From: adrian15 @ 2007-06-17 11:13 UTC (permalink / raw)
To: The development of GRUB 2
I've activated the echo command (also the pause command) which it is
equivalent to the echo command... and have done some tests:
grub> pause fjfjl
fjfjl
grub> pause "fjfjl"
fjfjl
grub> pause -n \n
error: Internal error
grub> pause \n
error: Internal error
grub> pause -n "\n"
\n
grub> pause -e "\n"
grub> echo fasf
fasf
grub>
Two conclusions from these tests:
1) When you use \n in string that does not begin with " then it gives an
internal error. I do not see anything special on echo.c so I suppose
it's the fault of the parser, however I have not studied the parser
yet... so marco_g what's your opinnion?
2) The -e option is not implemented. :) I've checked the code and it is
not. However I doubt if it's going to work... I ask myself if the grub>
string always appears at the beginning of the line.
pause is equivalent to echo command but if you want to check what I am
saying check my other email that contains a patch for having both echo
and pause commands.
adrian15
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: echo gives internal error with \n
2007-06-17 11:13 echo gives internal error with \n adrian15
@ 2007-07-22 13:27 ` Marco Gerards
2007-08-03 17:55 ` adrian15
0 siblings, 1 reply; 3+ messages in thread
From: Marco Gerards @ 2007-07-22 13:27 UTC (permalink / raw)
To: The development of GRUB 2
adrian15 <adrian15sgd@gmail.com> writes:
> I've activated the echo command (also the pause command) which it is
> equivalent to the echo command... and have done some tests:
The problem is in the parser.
> grub> pause fjfjl
> fjfjl
> grub> pause "fjfjl"
> fjfjl
> grub> pause -n \n
> error: Internal error
>
> grub> pause \n
> error: Internal error
>
> grub> pause -n "\n"
> \n
> grub> pause -e "\n"
>
> grub> echo fasf
> fasf
> grub>
>
>
> Two conclusions from these tests:
>
> 1) When you use \n in string that does not begin with " then it gives an
> internal error. I do not see anything special on echo.c so I suppose
> it's the fault of the parser, however I have not studied the parser
> yet... so marco_g what's your opinnion?
True, Bean sent in a patch to fix this.
> 2) The -e option is not implemented. :) I've checked the code and it is
> not. However I doubt if it's going to work... I ask myself if the grub>
> string always appears at the beginning of the line.
Do you want to implement this? ;-)
This should not be hard to do.
> pause is equivalent to echo command but if you want to check what I am
> saying check my other email that contains a patch for having both echo
> and pause commands.
ok.
--
Marco
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: echo gives internal error with \n
2007-07-22 13:27 ` Marco Gerards
@ 2007-08-03 17:55 ` adrian15
0 siblings, 0 replies; 3+ messages in thread
From: adrian15 @ 2007-08-03 17:55 UTC (permalink / raw)
To: The development of GRUB 2
Marco Gerards escribió:
> adrian15 <adrian15sgd@gmail.com> writes:
>
>> I've activated the echo command (also the pause command) which it is
>> equivalent to the echo command... and have done some tests:
>
> The problem is in the parser.
I see.
>> Two conclusions from these tests:
>>
>> 1) When you use \n in string that does not begin with " then it gives an
>> internal error. I do not see anything special on echo.c so I suppose
>> it's the fault of the parser, however I have not studied the parser
>> yet... so marco_g what's your opinnion?
>
> True, Bean sent in a patch to fix this.
:) I knew this already.
>
>> 2) The -e option is not implemented. :) I've checked the code and it is
>> not. However I doubt if it's going to work... I ask myself if the grub>
>> string always appears at the beginning of the line.
>
> Do you want to implement this? ;-)
>
> This should not be hard to do.
Implementation is easy but what's difficult for me is the design decision.
Here there are three possible scenarios:
1a) When grub> is showed it does begin in the last character position
(not in a new line).
This might imply rewriting the end of the programs so that they end
with something similar to: grub_printf("\n");
1b) Same than 1a but the execution of the last grub_printf("\n"); is
automatically run from the "program than runs one command after another
one. (I do not know the name in grub2.)" depending on a new special flag
of the program.
2) The echo command with a -e option sets a variable which is checked
each time the grub> line is going to be written. Depending on the
variable grub_printf("\ngrub>"); or grub_printf("grub>"); is run.
At what implementation were you thinking to issue this problem?
>
>> pause is equivalent to echo command but if you want to check what I am
>> saying check my other email that contains a patch for having both echo
>> and pause commands.
Well... I think you do not need to check my patch... the idea is that
pause command is the echo command plus a pause. Something like:
pause.sh:
echo $@ ; read
exit
So the pause command can have all the echo command power.
I also might work in the read command although I have to think more
about it.
adrian15
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-03 17:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-17 11:13 echo gives internal error with \n adrian15
2007-07-22 13:27 ` Marco Gerards
2007-08-03 17:55 ` adrian15
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.