Is there a way for gxmessage to use newlines in displaying messages ?
ex.
First line
second line
Newline for gxmessage ?
Newline for gxmessage ?
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Code: Select all
MSG="First line
second line"
gxmessage "$MSG"
Code: Select all
gxmessage $'First line\nSecond line'
I just had a similar problem and found this works:
It works because when gxmessage is sent text from a file it prints the newlines properly. Telling it to use "-" as the source file makes it get the text from the standard input. And echo -e tells echo to use escape commands, such as \n for newline, \t for tab, etc.
Code: Select all
echo -e "first line \nsecond line" | gxmessage -file -
[color=blue]A life! Cool! Where can I download one of those from?[/color]
Unless I am misunderstanding the question you can just type exactly what you want including using the enter key to step to a new line.
eg:
Oh - i just realised how old the thread is.
eg:
Code: Select all
#! /bin/bash
gxmessage " This is the line 1 info
This is the third line - leaving the second line blank.
Here is the fourth line - notice it is not spaced out from the margin"
- Attachments
-
- gxmessage.jpg
- (15.77 KiB) Downloaded 84 times
Huh... I'd been testing from the commandline. I never even tried that solution in a script. Seems really obvious, now. Amazing how easy it is to overlook the obvious.
Thanks GreenGeek.
(I'm really glad old threads remain active here.)
Thanks GreenGeek.
(I'm really glad old threads remain active here.)
[color=blue]A life! Cool! Where can I download one of those from?[/color]