ps1

Linux:shell基础(二) :PS1

♀尐吖头ヾ 提交于 2019-12-03 02:45:31
PS1:定义系统提示符的变量 \d:显示日期,格式为“星期 月 日” \h:显示简写主机名,如默认主机名“localhost” \t:显示24小时制时间,格式为“HH:MM:SS” \T:显示12小时制时间,格式为“HH:MM:SS” \A:显示24小时制时间,格式为“HH:MM” \u:显示当前用户名 \w:显示当前所在目录的完整名称 \W:显示当前所在目录的最后一个目录 \#:执行第几个命令 \S:提示符,如果是root用户会显示提示符为“#”,如果是普通用户,会显示提示符为“$” 来源: https://www.cnblogs.com/rtczza/p/11774451.html

.ps1 cannot be loaded because the execution of scripts is disabled on this system? [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This question already has an answer here: PowerShell says “execution of scripts is disabled on this system.” 21 answers I run this code to execute power shell from an asp.net application: System . Management . Automation . Runspaces . Runspace runspace = System . Management . Automation . Runspaces . RunspaceFactory . CreateRunspace (); runspace . Open (); System . Management . Automation . Runspaces . Pipeline pipeline = runspace . CreatePipeline (); pipeline . Commands . AddScript (@ "\\servername\path" ); pipeline . Commands .

zsh not re-computing my shell prompt

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This might be a bit fringe, but I recently moved to zsh and am having a problem customizing my shell prompt. Part of my .zshrc looks like this: # keeping this simple right now by just printing the date, but imagine this function would look for something specific when moving to a new directory each time function parse_special { print $ ( date ) } autoload - U colors && colors PS1 = "%{$fg[green]%}%n@%m %{$fg[blue]%}%c %{$fg[yellow]%}%{$(parse_special)%} %{$reset_color%}%# " When I launch terminal, everything looks good; my prompt is

What is your favorite Bash prompt? [closed]

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What are some elements in your favorite Bash prompt? I like to have an indicator of the success of the most recent command, like so (in .bashrc ): function exitstatus { EXITSTATUS="$?" BOLD="\[\033[1m\]" RED="\[\033[1;31m\]" GREEN="\[\e[32;1m\]" BLUE="\[\e[34;1m\]" OFF="\[\033[m\]" PROMPT="[\u@\h ${BLUE}\W${OFF}" if [ "${EXITSTATUS}" -eq 0 ] then PS1="${PROMPT} ${BOLD}${GREEN}:)${OFF} ]\$ " else PS1="${PROMPT} ${BOLD}${RED}:(${OFF} ]\$ " fi PS2="${BOLD}>${OFF} " } PROMPT_COMMAND=exitstatus 回答1: Take a gander at " Bash users: What do you have

i want to execute a .ps1 powershell script in red hat linux server

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am having a .ps1 powershell script which executes in window, but my whole data is in linux server, is there any possible way via which i can execute the powershell script in red hat server the powershell script is : Clear-Host $path="D:\Deep Backup 26-04-2013\New folder" $systemname=Read-Host 'Enter System Name' $files=Get-ChildItem $path -Recurse -Force -Include *_Registrar.zip*,*.reg.zip* $counter=1 foreach($file in $files) { $name=$file.name [void][system.reflection.Assembly]::LoadFrom("C:\Program Files\MySQL\MySQL Connector Net 6.5.4

Git sh.exe process forking issue on windows XP, slow?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Git is essential to my workflow. I run MSYS Git on Windows XP on my quad core machine with 3GB of RAM, and normally it is responsive and zippy. Suddenly an issue has cropped up whereby it takes >30 seconds to run any command from the Git Bash command prompt, including ls or cd . Interestingly, from the bash prompt it looks likes ls runs fairly quickly, I can then see the output from ls , but it then takes ~30 seconds for the prompt to return. If I switch to the windows command prompt (by running cmd from the start menu) git related

-bash: __git_ps1: command not found

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to install Ruby 2.0. My command line urped and now looks like the following: -bash: __git_ps1: command not found [11:58:28][whatever@whatever ~]$ I have not a clue how to get rid of the __git_ps1 command not found error. I've searched my .bash_profile and my .bashrc to see if it's trying to set a variable or something and am not seeing anything. The only place I can find git_ps1 mentioned is in ~/.dotfiles/.bash_prompt. I replace the content of that file completely, logout and log back in and it fixes nothing. I saw this , but I'm

Shell Prompt Line Wrapping Issue

强颜欢笑 提交于 2019-12-03 00:53:34
问题 I've done something to break my Bash Shell Prompt in OS X (10.5.7) Terminal. This is the PS1 that I had configured: PS1='\[\e[1;32m\]\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ ' As far as I can tell I have the color commands escaping correctly. However when I scroll up and down in my command history I often get line wrapping issues if the historic commands wrap onto multiple lines. I simplified my prompts to the following: PS1='\[\e[1m\]\h:\w\$ \[\e[0m\]' PS2='> ' And I still see something like:

PS1 env variable does not work on mac

我怕爱的太早我们不能终老 提交于 2019-12-02 23:59:14
I have a script(not written by myself) which shows the git branch/svn branch in my command prompt. Does anyone know why this would not work on mac? It works perfectly in linux. From https://github.com/xumingming/dotfiles/blob/master/.ps1 : # Display ps1 with colorful pwd and git status # Acording to Jimmyxu .bashrc # Modified by Ranmocy # -- if type -P tput &>/dev/null && tput setaf 1 &>/dev/null; then color_prompt=yes else color_prompt= fi __repo () { branch=$(type __git_ps1 &>/dev/null && __git_ps1 | sed -e "s/^ (//" -e "s/)$//") if [ "$branch" != "" ]; then vcs=git else branch=$(type -P hg

Yocto:从bbfile到sdk

匿名 (未验证) 提交于 2019-12-02 23:38:02
创建bb file: poky/meta/recipes-devtools/nativesdk-custom-ps1-setting/nativesdk-custom-ps1-setting.bb $ vi ../../poky/meta/recipes-devtools/nativesdk-custom-ps1-setting/nativesdk-custom-ps1-setting.bb LICENSE = "CLOSED" inherit nativesdk do_generate(){ echo "export PS1=\"(yocto-sdk) \${PS1}\"" > ${B}/custom-ps1-setting.sh } do_install(){ install -d ${D}/environment-setup.d/ cp ${B}/custom-ps1-setting.sh ${D}/environment-setup.d/ } addtask generate PACKAGES = "${PN}" FILES_${PN} = "/" do_generate() 创建文件:build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-custom-ps1-setting/1.0-r0/custom-ps1