English version Russian version Version française Nederlandse versie Versión española Version portuguese Version polonaise Italian version Versiunea româna   KiTTY News

KiTTY : Forum

Last modification : -

KiTTY web site




Forum Home
 

automatic command swallowing newline

Craig - Thu 29/03/2012 19:06:26 CEST +0200

I use the following in the command field:

umask 0002 \n export PS1='\n[\d \t \u@\h]\n[\w] \$ '

when it runs I see:

-bash-3.2$ umask 0002
-bash-3.2$ export PS1='[\d \t \u@\h][\w] $ '

As you can see the \n seems to disappear, actually it looks like it becomes a space character. Is there an alternate way of getting that through or is this a buglet?

Craig

Craig - Fri 30/03/2012 12:12:01 CEST +0200

I see things didn't paste well. The "command" has double backslashes for everything except the \n separator between umask and export PS1.

It also seems the \$ becomes $.

Craig

Craig - Wed 04/04/2012 12:45:16 CEST +0200

Well I did get this working...

Entering

umask 0002 \nexport PS1='\\x6e[\d \t \u@\h]\\x6e[\w]\x20\$'

where \\x6e becomes the \n, and \x20\$ becomes the $.

Not sure if this will paste correctly, so in words:

To get slash-n, you need 3 slashes, the first two become a slash, then you need slash-x6e to give the n character.

For the slash-$ I needed to change the space before that to a slash-x20 to get a space character.




Answer


The forum is actually closed