Search Results

Search found 241 results on 10 pages for 'ps1'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Colored PS1 string

    - by Will Vousden
    Clarification: I want __foo to be executed each time the PS1 string is presented in the terminal, not when the PS1 string is constructed (hence its being in quotes). __foo contains logic that examines the current directory, so its execution must be deferred. I'm trying to use different colours in my Bash PS1 string from within a Bash function: LIGHTRED="\033[1;31m" LIGHTGREEN="\033[1;32m" RESET="\033[m" __foo () { # Do some stuff and genereate a string to echo in different colours: echo -n '\['$1'\]firstcolour \['$2'\]secondcolour' } PS1='$(__foo '$LIGHTRED' '$LIGHTGREEN')\['$RESET'\] \$' Essentially I want __foo to generate part of the PS1 in a bunch of different colours. My attempt doesn't seem to work, though; it produces the following output: -bash: 31m: command not found -bash: 32m: command not found \[]firstcolour \[\]secondcolour $ What gives, and how can I fix it?

    Read the article

  • bash: How to evaluate PS1, PS2, ...?

    - by Harry
    Is there any way to 'evaluate' PS1, PS2, etc from within a bash script? Although, I can use alternate means to get all elements of my current PS1, I would really like to be able to reuse its definition instead of using these alternate means. For example, ===================================== PS1 element --> Alternate means ===================================== \u --> $USER \h --> $HOSTNAME \w --> $PWD ... ===================================== I could very well use the 'alternate means' column in my script, but I don't want to. In my PS1, I, for example, use bold blue color via terminal escape sequences which I'd like to be able to simply reuse by evaluating PS1.

    Read the article

  • Setting XFCE terminal PS1 value and making it permanent

    - by Matt
    I'm trying to add the value PS1='\u@\h: \w\$ ' to my terminal in XFCE. I added the line to (what I think is) the correct area in /etc/profile. The relevant segment is: # Set a default shell prompt: #PS1='`hostname`:`pwd`# ' PS1='\u@\h: \w\$ ' if [ "$SHELL" = "/bin/pdksh" ]; then # PS1='! $ ' PS1='\u@\h: \w\$ ' elif [ "$SHELL" = "/bin/ksh" ]; then # PS1='! ${PWD/#$HOME/~}$ ' PS1='\u@\h: \w\$ ' elif [ "$SHELL" = "/bin/zsh" ]; then # PS1='%n@%m:%~%# ' PS1='\u@\h: \w\$ ' elif [ "$SHELL" = "/bin/ash" ]; then # PS1='$ ' PS1='\u@\h: \w\$ ' else PS1='\u@\h: \w\$ ' fi Most of that was already there, I just commented out the existing value and added the one I want. By manually opening the terminal and doing . profile, I can load these values, but they don't stick - I close the terminal and reopen, and I'm back to sh-4.1$. Maybe I'm doing this in the wrong place, but how can I make that value stick? All the info I've found on google is Fedora/Ubuntu-specific. I use Slackware. Any help on this matter would be greatly appreciated.

    Read the article

  • where does the discrepancy between \# in PS1 and n in !n come from?

    - by Cbhihe
    Something has been gnawing at me for a while now and I can't seem to find a relevant answer either in man pages or using your 'Don't be evil' search engine. My .bashrc has the following: shopt -s histappend HISTSIZE=100 HISTFILESIZE=0 # 200 previous value Putting HISTFILESIZE to 0 allows me to start with a clean history slate with each new term window. I find it practical in conjunction with using a prompt that contains \#, because when visualizing a previous command before recalling it with !n or !-p, one can just do: $ history | more to see its relevant "n" value In my case, usually the result of: $ \history | tail -1 | awk '{print $1}' # (I know this is an overkill, don't flame me) equals the expanded value of # in PS1 minus 1, which is how I like it to be at all times. But then, sometimes not. At times the expanded value of # sort of "runs away". It's incremented in such a a manner that it becomes than $(( $(\history | tail -1 | awk '{print $1}')+1 )) Any pointers, anyone?

    Read the article

  • Why does subshell not inherit exported variable (PS1)?

    - by amn
    After some debugging I finally narrowed down the problem as to why my X session xterm prompt does not appear according to my PS1 setting. If I run sh -c env, it doesn't even show PS1 in the list. Why? export PS1='test' sh -c env # No PS1 in the list, default prompt appearance (shell name + version) Substituting sh with bash yields same result, alas the behavior appears to be the same for both shells/modes. As far as I understood from man bash, the environment resulting from command run by shell with -c should include the exported variables. And it does - exporting FOOBAR results in FOOBAR listed in env run by subshell. It appears that the story is different if the variable is PS1 however. What is going on? I want my prompt propagated throughout the process tree and system. For matters sake, it is set in /etc/profile.d/user.sh (a file I created myself) with the following: PS1='\u@\H \w \$ ' export PS1 I am running Arch Linux (updated yesterday.)

    Read the article

  • Anomaly with bash PS1 definition

    - by Michael Wiles
    My root and admin user both have the same .bashrc file. The prompt section of the .bashrc is the following: if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" ;; *) ;; esac But the problem is that the admin user and root user have different prompts. admin's prompt is: admin@hostname:~$ and root's prompt is root@hostname:/home# So it seems root is using the "xterm" version and admin is not. Why does the .bashrc file have this difference in prompts? How do I get the admin user to also use the xterm version? How would I test that condition? If I run echo $TERM while running as the admin user I get xterm so as far as I can tell, it should be using the xterm version for the admin user.

    Read the article

  • Is it possible to have environment variables in the path of the working directory : PS1?

    - by mthpvg
    I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is : PS1="\w> " I like it because I need to paste the working directory all the time. The problem is that the path is always very long and since I use terminator I only have half of my screen's width available to display it... it is ugly and annoying. My command prompt looks like that : /this/is/a/very/long/path/that/i/want/to/make/shorter > I'd like to set in my environment variables : $tiavl=/this/is/a/very/long And then I'll get : $tiavl/path/that/i/want/to/make/shorter > The goal is to have something shorter in the command prompt but I still want to be able to copy paste it and do : cd $tiavl/path/that/i/want/to/make/shorter It is a bit like with $HOME : ~/path/that/i/want/to/make/shorter > I know where I am and I can copy paste the ~. Thanks.

    Read the article

  • Emulator PCSX Reloaded - Fullscreen not working on Unity

    - by Leonardo Montenegro
    I have an older PS1 console with a couple of games I bought some years ago. On my pc, I'm using PCSX Reloaded - the best PS1 emulators for Linux I found so far. But I'm having a little issue on Ubuntu 12.04 Precise. I'm using Unity 3D and I'm trying to run some of my original PS1 games on PCSX Reloaded. Everything works nicely, except for fullscreen. I toggle fullscreen and specify maximum resolution for my monitor, but on fullscreen mode, both left and top unity bars aren't getting hidden. I tried changing between other graphic modes like Gnome Classic and Gnome Classic w/o Effects. On both, PCSX shows bars in fullscreen mode, so it isn't an Unity-specific issue, but an emulator problem. It's a bit annoying play games this way, so basically I'm running games on window mode for now. I'm using default OpenGL graphic plugin on this emulator. I tried changing to X11 graphic plugin and fullscreen worked, but graphics on X11 plugin aren't as good as OpenGL one. Anyone know a way to get fullscreen working on PCSX using OpenGL plugin? Or maybe another graphic plugin w/ OpenGL support.

    Read the article

  • Solving Null Entity Problems with JPA Data Controls in PS1

    - by shay.shmeltzer
    Turns out there is a slight bug that seems to prevent you from doing interactions (update, scroll) with the results of a JPA named query that you dropped on a page using ADF Binding. People are running into this when they are doing the EJB tutorial on OTN for example. The problem is that the way the binding is set up for you automatically doesn't allow you to actually access the iterator set of records to do follow up operations. When I last checked this was solved in the next release of JDeveloper, but in the meantime there is a quick simple way to resolve the issue by changing the refresh condition of the oiterator in your page binding. Here is a little demo that shows the problem and the solution:

    Read the article

  • Upgrading PS1 Light Gun [on hold]

    - by Nathan Taylor
    Is There any possible way to upgrade the retro G-con Light Gun for PS1 to allow it to interact with HD TV's? I am aware that they were Designed purely for Tube TV's but I would be happy to know of any hardware that would maybe convert the light to hit the Pixels on an LCD TV. If not is there any other Light gun that would work on PS1 games but has the newer light gun hardware that can interact with a higher Pixel LCD TV?

    Read the article

  • zsh right-justify in ps1

    - by Nate
    I'd like a multi-line zsh prompt with a right alined part, that will look something like this: 2.nate@host:/current/dir 16:00 -> I know about RPROMPT in zsh, but that has a right-aligned prompt opposite your normal prompt, which is on the same line of text as your typing. Is there a way to have a right-aligned portion to the first line of a multi-line command prompt? I'm looking for either a directive in the PS1 variable that says 'right align now' or a variable that is to PS1 what RPROMPT is to PROMPT. Thanks!

    Read the article

  • How do you increase the number of processes in parallel with Powershell 3?

    - by Mark Shay
    I am trying to run 20 processes in parallel. I changed the session as below, but having no luck. I am getting only up to 5 parallel processes per session. $wo=New-PSWorkflowExecutionOption -MaxSessionsPerWorkflow 50 -MaxDisconnectedSessions 200 -MaxSessionsPerRemoteNode 50 -MaxActivityProcesses 50 Register-PSSessionConfiguration -Name ITWorkflows -SessionTypeOption $wo -Force Get-PSSessionConfiguration ITWorkflows | Format-List -Property * Is there a switch parameter to increase the number of processes? This is what I am running: Workflow MyWorkflow1 { Parallel { InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 2 and 2975416"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 2975417 and 5950831"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 5950832 and 8926246"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 8926247 and 11901661"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 11901662 and 14877076"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns"where OrderId between 14877077 and 17852491"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 17852492 and 20827906"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 20827907 and 23803321"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 23803322 and 26778736"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 26778737 and 29754151"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 29754152 and 32729566"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 32729567 and 35704981"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 35704982 and 38680396"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 38680397 and 432472144"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 432472145 and 435447559"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 435447560 and 438422974"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 864944289 and 867919703"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 867919704 and 870895118"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 870895119 and 1291465602"} InlineScript { import-module \\PS_Scripts\bulkins.ps1; BulkIns "where OrderId between 1291465603 and 1717986945"} }

    Read the article

  • Bash PS1 settings - how to get the current folder back as the terminal title

    - by Max Williams
    Hi all. I recently added these lines to my ~/.bashrc file to show the current branch if i'm in a git working folder, and it works nicely for that. However, what i've lost is that the current folder name used to be shown in the tab for the terminal i have open, and now it isn't: it always just says 'Terminal'. Can i get that back and still keep the git stuff? Here's the lines in question - it's the second one that's the issue, as commenting out just the second line fixes the problem. source /etc/bash_completion.d/git PS1='\h:\w$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]")$ ' I've been looking at explanations of the options for PS1 but can't see anything about the terminal window's title in there. Can anyone advise? thanks, max

    Read the article

  • What is the difference between PS1 and PROMPT_COMMAND

    - by Jed Daniels
    While taking a look at this awesome thread I noticed that some examples use PS1="Blah Blah Blah" and some use PROMPT_COMMAND="Blah Blah Blah" (and some use both) when setting the prompt in a bash shell. What is the difference between the two? An SO search and even a bit of broader google searching aren't getting me results, so even a link to the right place to look for the answer would be appreciated. Thanks!

    Read the article

  • How can I style the command being entered in a bash prompt?

    - by C4H5As
    While watching this intro video to Brunch, at about t=1:30 the command prompt being used has some very cool styles. The part I'm interested in is how the presenter managed to colour the text being entered on the prompt, while it's being entered. It looks like the first argument is coloured green when it becomes a valid executable command & purple when it's invalid. Successive arguments appear white, though it looks like a valid file path gets an underline (see ~ t=2:01). What's the trick here? Is this a custom terminal emulator? Is it some kind of magic $PS1?

    Read the article

  • How can I set `less` or `more` max lines (scrollable height) limit/boundary in linux?

    - by Rudie
    (Sorry for the title. Any suggestions?) I've set my commandline PS1 to cover 3 lines: white space user, server and pwd $ or # to input I think less (or more?) is configured to break after window's height - 1, because when I do a $ git log, the first two lines are invisible at the top of the window and the rest is scrollable. I'm not sure who handles this scrolling and its configuration, but I assume GIT uses less/more. Where can I configure that my scrollable window is window height - 3 lines and not window height - 1? More info: If I cat lines.txt | less with a 23 line file, it shows the entire file and no scrolling. If I do the same with a 24 line file, it doesn't show line 1 (and no scrolling). With 25 lines: doesn't show lines 1 and 2 (and no scrolling). With 26 lines: shows line 1 and scrolling! The less breakpoint is at the wrong height...

    Read the article

  • `export PS1='value'` does not propagate to (Korn) subshells for root?

    - by user319845
    Please consider the following /root/.profile: export PS1=value1 export x=value2 How come the login shell shows the expected prompt (and $x as value2), while the subshells keep showing $x as value2 but $PS1 as '#'? Just in case, I'm trying this under OpenBSD. [Yeah, I know... What on earth am I doing with OpenBSD if I don't know this? Just toying... in an isolated, most definitely non-production VM =).]

    Read the article

  • I added __git_ps1 to my PS1 in .bash_profile, now I'm getting (master) for all folders that aren't git repos.

    - by Matthew
    I'm on a Mac (10.6.5). Here's an example of what's going wrong: [m@m ~ (master)]$ cd ~/Documents [m@m ~/Documents (master)]$ cd ~/Applications [m@m ~/Applications (master)]$ cd ~/Library [m@m ~/Library (master)]$ cd ~/Sites/somesite [m@m ~/Sites/somerepo (FEATURE_SOMEFEATURE)]$ Here's the relevant contents of my .bash_profile: source ~/.git-completion.bash PS1='[\u@\h \w$(__git_ps1 " (%s)")]\$ ' I'm using the standard git-completion script - I just copied it to my home directory.

    Read the article

  • Override properties block when including a psake script in an other psake script

    - by DanceAlot
    I am new to psake and I have this issue: I have 2 psake scripts: (1): base_tasks.ps1: properties{ $a = "hello" $b = "hi" } task One{ Write-Host $a } (2): install.ps1 Include .\base_tasks.ps1 properties{ $a = "Goodbye" $b = "Adjeu" } task default -depends One Now, is it possible to override the properties and variables from file 1? I want to use file 1 as "base tasks" and use the tasks in the install.ps1 and override the properties. Or do I have to do that an other way? I will invoke install.ps1 and use my $a and $b from install.ps1. DanceAlot

    Read the article

  • NSClient++: external script with optional arguments

    - by syneticon-dj
    I am trying to define an external script which would take optional arguments in NSClient++ 0.4.1 on Windows. Following the nsclient-full.ini example code I have defined mycheck=cmd /C echo C:\mydir\myscript.ps1 %ARGS% | powershell.exe -command - which simply yields the string %ARGS% passed as the only argument to myscript.ps1, no matter what I specify in my call through NRPE (using Nagios' check_nrpe if that matters). I then tried to rewrite the definition to mycheck=cmd /C echo C:\mydir\myscript.ps1 $ARG1$ $ARG2$ | powershell.exe -command - (myscript.ps1 would take up to two arguments), which does help a bit. At least, if two arguments are provided, I can fetch them via the args[] array. The trouble starts when the call has less than two arguments - in this case the literal strings $ARG2 and $ARG1$ are passed through as arguments. Handling this case in the code of myscript.ps1 makes the whole argument processing routine ugly at best. Is there a sane way of defining optional parameters to an external script which would not pass NSClient's variable names if no parameter has been specified?

    Read the article

  • Drag and Drop to a Powershell script

    - by Nathan Hartley
    I thought I had an answer to this, but the more I play with it, the more I see it as a design flaw of Powershell. I would like to drag and drop (or use the Send-To mechanism) to pass multiple files and/or folders as a array to a Powershell script. Test Script #Test.ps1 param ( [string[]] $Paths, [string] $ExampleParameter ) "Paths" $Paths "args" $args I then created a shortcut with the following command line and dragged some files on to it. The files come across as individual parameters which first match the script parameters positionally, with the remainder being placed in the $args array. Shortcut Attempt 1 powershell.exe -noprofile -noexit -file c:\Test.ps1 I found that I can do this with a wrapper script... Wrapper Script #TestWrapper.ps1 & .\Test.ps1 -Paths $args Shortcut Attempt 2 powershell.exe -noprofile -noexit -file c:\TestWrapper.ps1 Has anyone found a way to do this without the extra script?

    Read the article

  • Default value list for pipeline param in Powershell

    - by fatcat1111
    I have a Powershell script that reads values off of the pipeline: PARAM ( [Parameter(ValueFromPipeline = $true)] $s ) PROCESS { echo "* $s" } Works just fine: PS my.ps1 foo * foo I would like the script to have list of default values, as the most common usage will always use the same values and storing them in the default will be most convenient. I did the usual assignment: PARAM ( [Parameter(ValueFromPipeline = $true)] $s = 'bar' ) PROCESS { echo "* $s" } Again, works just fine: PS my.ps1 * bar PS my.ps1 foo * foo However when setting the default to be a list, I get back something entirely reasonable but not at all what I want: PARAM ( [Parameter(ValueFromPipeline = $true)] $s = @('bar', 'bat', 'boy') ) PROCESS { echo "* $s" } Result: PS my.ps1 * bar bat boy I expected: PS my.ps1 * bar * bat * boy How can I get one call in to the Process loop for each default value? (This is somewhat different than getting one call in to Process, and wrapping the current body of in a big foreach loop over $s).

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >