Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Send Bash Command

by bichonfrise74 (Vicar)
on Mar 03, 2010 at 19:03 UTC ( #826496=note: print w/replies, xml ) Need Help??

in reply to Re: Send Bash Command
in thread Send Bash Command

Out of curiosity, I tried your script in Linux OS and it seems to work. But if you do a 'ls', the red prompt turns back to black. Anyway, I think it is a good attempt.

Replies are listed 'Best First'.
Re^3: Send Bash Command
by Khen1950fx (Canon) on Mar 03, 2010 at 21:48 UTC
    That's interesting. If you do a 'man ls', the man page turns to black. But when you 'q', it goes back to red:). I think that "prompt" is basically good for the first command. Then you need to switch to something like 'system' as in this work-around:
    #!/usr/bin/perl use strict; use warnings; use ExtUtils::MakeMaker qw(prompt); prompt("export PS1=\e[0;31m\][\\u@\\H\\W\]\$\\e]m"); system("ls");
    However, I like the idea of using 'ls' to return to the former color. It's quicker than restarting the terminal:).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826496]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2018-06-18 11:25 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.