Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: How to change an xterm title on the fly

by stefan k (Curate)
on Oct 22, 2001 at 18:39 UTC ( #120539=note: print w/replies, xml ) Need Help??

in reply to How to change an xterm title on the fly

Of course one could push it further and make the xterm title display the current path. Actually this is no perl code but I really don't see the need for perl here.
# The Prompt unset PROMPT_COMMAND case $TERM in xterm*) TITLEBAR='\[\033]0;\h:\w\007\]' ;; *) TITLEBAR='' ;; esac PS1="${TITLEBAR}\u@\[\033[1;34m\]\h\[\033[0m\]:\W> " export PS1 PS2
(to put into your ~/.bashrc - yeah, we're really OT here ;-)

Regards... Stefan
you begin bashing the string with a +42 regexp of confusion

Replies are listed 'Best First'.
Re: Re: How to change an xterm title on the fly
by suaveant (Parson) on Oct 22, 2001 at 18:45 UTC
    Well... my real purpose was to show the basics of how to change it for perl (since this is PerlMonks :) I leave it up to the user to decide what they want to do with it. I was using it to put the current song from my mp3 jukebox script in the title...

                    - Ant
                    - Some of my best work - (1 2 3)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://120539]
[ovedpo15]: The only thing I know is that there is a comma at the end and a value after that
[hippo]: Try it and see. Your computer won't explode.
[Corion]: length will tell you the length of a string.
[Corion]: But if you are parsing CSV, again, let me point to Text::CSV_XS, which you should use instead
[hippo]: +1 for Text::CSV_XS
[ovedpo15]: Im not allowed to use additional modules, so I can't use it. looking for a simple regex to do this task though..
[Corion]: Ah, so this is homework? Then most likely, you should review your course material closer. It would greatly surprise me if the course material wouldn't mention the topics that will be used in the homework...
[Corion]: I already showed you the simple regex to match the last part of a string without a comma in it
[Tux]: Corion++ hippo++

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-05-27 10:41 GMT
Find Nodes?
    Voting Booth?