On Sat, Sep 07, 2013 at 04:35:09PM +1000, Zenaan Harkness wrote:
> I want to have a script, to change between a few prompts per the arg
> supplied. This is so I can quickly change from my glorious
> bells-and-whistles prompt to a plain prompt (eg for cut and paste to
> debian-user, just "$ " or "#
Dear Zenaan,
I tried the same by putting those code in a script - myprompt.bash like below
#!/usr/bin/bash
PS1=': '
In terminal, when I run like '. ./myprompt.bash', it is working as expected.
Also I tried with alias like below and that also worked for me.
alias myprompt="export PS1=': '"
S
On 9/7/13, der.hans wrote:
> Am 07. Sep, 2013 schwätzte Zenaan Harkness so:
>
> moin moin Zenaan,
>
> Rather than all the convolutions of command substitution, how about just
> using a function that's in your profile or bashrc?
>
> $ cat /tmp/bashrc
> function changeps() {
> export PS1=':
On 9/7/13, Zenaan Harkness wrote:
> On 9/7/13, Zenaan Harkness wrote:
>> So I thought, run the script in a subshell, executing the result, like:
>> $ `ps1`
>>
>> The following 3-line script is meant to test exactly this:
>>
>> #!/bin/bash
>> PS1=': '
>> echo "export PS1=$PS1"
After trying a few
Am 07. Sep, 2013 schwätzte Zenaan Harkness so:
moin moin Zenaan,
Rather than all the convolutions of command substitution, how about just
using a function that's in your profile or bashrc?
$ cat /tmp/bashrc
function changeps() {
export PS1=': '
}
$ . /tmp/bashrc
$ changeps
:
Add a
On 9/7/13, Zenaan Harkness wrote:
> So I thought, run the script in a subshell, executing the result, like:
> $ `ps1`
>
> The following 3-line script is meant to test exactly this:
>
> #!/bin/bash
> PS1=': '
> echo "export PS1=$PS1"
When I change the last line to this:
echo "export PS1=\"${PS1}
I want to have a script, to change between a few prompts per the arg
supplied. This is so I can quickly change from my glorious
bells-and-whistles prompt to a plain prompt (eg for cut and paste to
debian-user, just "$ " or "# " depending on current user) to a
timestamped prompt (when I have some lo
7 matches
Mail list logo