Tag Info

Hot answers tagged

14

Not sure there is an answer to this when using a mouse. If you wanted a command-line way to do it, you can just echo the command and pipe that output to clip: echo stuff you wanted copied to the clipboard | clip FYI, clip is available on Windows 2003. I believe it is a built-in.


8

Wrap each of your color variables in escaped square brackets: \[${COL_USR}\] or COL_USR="\[${COL_Y}${COL_BRIGHT}\]" That tells Bash that these are to be considered zero-width. This is exactly as described in the question you linked to. If you do the following command, you'll see that your variable contain similar character sequences to the ...


7

A possible answer would be that [my_name@my_machine /var/www/html/my_site/my_subdir/another_subdir/yet_another_subdir/and_more_subdirs_yet/see_here/another_subdir/etc $] _ would be a very inconvenient for you to work with


7

You probably have escape sequences for colors in your prompt that are not properly delimited. They need to be enclosed in \[ and \]. PS1='\[\033[1;36m\]\u\[\033[0m\]@\[\033[1;34m\]\h\[\033[0m\]\$ ` The length of non-printing character sequences are not included in the length of the prompt when they are thus enclosed and the position of previous commands ...


6

The "read" built-in can do editing, using the Readline library, if you give it the "-e" flag: read -e foo


6

Add your modified PS1 setting to /etc/profile.d/custom_ps1.sh. Files under /etc/profile.d are automatically sourced from /etc/profile: if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi Which is called whenever a login shell is spawned. From the bash manpage: When bash is ...


5

Here are some things you could try: probe-scsi-all at the ok prompt. It maybe that it sends the START UNIT command to the drive. If not then try setenv auto-boot? false and reset-all. This should bring you back to the ok prompt (hopefully the tray is now closed and you can boot cdrom The crux of it is getting the SCSI "START UNIT" command to the drive. If ...


5

There's a bash built-in test for TTY. I forget when it was added, 3.0? I believe it's relatively new. I use it in scripts where I need different behavior when it's run from cron or a user runs it directly. if [ -t 0 ]; then echo "I'm a TTY" fi


5

The answer is simple — it's a relic of times where terminals were 80 characters wide. Look at your own example — username & host occupies already 16 chars. With additional brackets and spaces there's 20 chars already, and we haven't counted the directory name yet. And the directories can have pretty long names, too. Your example path counts 21 chars and ...


4

I've been experimenting with the following to emulate the feature from zsh in Bash: $ unset PROMPT_SP; for ((i = 1; i <= $COLUMNS + 52; i++ )); do PROMPT_SP+=' '; done $ PS1='\[\e[7m%\e[m\]${PROMPT_SP: -$COLUMNS+1}\015$ ' It issues a reverse video percent sign, followed by a bunch of spaces to make it wrap to the next line, then a carriage return, ...


4

\[ and \] should only be used around parts of the command prompt that do not advance the cursor, despite having actual text. if __git_ps1 produces any visible output then this will desynchronize your command line.


3

Try using an explicit call to hostname -f to get the fqdn of the system export PS1="\[\u@$(hostname -f): \w\]\$ " e.g. iain$ export PS1="\[\u@$(hostname -f): \w\]\$ " iain@ub10-04-1.lan: ~$ EDIT: Further research shows that the contents of /etc/hostname (Ubuntu) and /etc/sysconfig/network (CentOS) are relevant. If the FQDN is in the file then the \H ...


3

Put the following at the beginning of /etc/bashrc [ -z "$PS1" ] && return


3

Possibly a bug in PsExec in v1.95? I have v1.94 and get the output fine but i've just downloaded the latest copy and get the same problems as yourself. EDIT: PsExec on my public SkyDrive


3

These delays are very frequently caused by DNS issues. Make sure that this server's resolv.conf is configured correctly.


3

Prompts are set by environment variables in bash including PS1 and PS2. If the variables are defined in the configuration files you copied over make sure you have sourced them with the dot command (. .profile) or logout and login to make sure they are reloaded. You can check their values with shell commands like: echo PS1="$PS1" PS2="$PS2". Ref: ...


2

PS1='[`git rev-parse --abbrev-ref HEAD 2> /dev/null`]$ ' see here for help on the particular git command used. The key for me was to realize that I can plug arbitrary commands into the PS1 environment variable :)


2

One way you can test to see what's happening during your ssh login is to use debug/verbose mode: ssh -v my.host or ssh -vv my.host This would show the debug messages that happen as you log in, the second option being more verbose than the first. (ref http://linux.chrissweeney.co.uk/topic.php?t=21) Also on the server-side, perhaps check ...


2

I can recommend Console. It copies multiple lines more sanely. FYI: I find the default mouse button options are different from cmd, so you may wish to change them.


2

In Red Hat based distros there is a package bash-completion. This package fills the /etc/bash_completion.d/ directory with specific completion behaviour for several programs. I'm using it under Fedora, Red Hat and CentOS. yum install bash-completion


2

I don't know of directly ported functionality, but there is a way to hack this in bash. Programmable completion allows you to specify what you'd like to see when you hit that tab key dependent on the calling program, allowing (as a popular example) ssh [tab] to show autocomplete options from ~/.ssh/known_hosts. Here are some useful resources: Intro, ...


2

Make your autologin user's login shell be rbash, and make the script the only thing they can run. Even if they escape the script, they won't be able to do anything except log out or start the script again.


2

This is the correct version: COLOR1="\[\e[1;32m\]" COLOR2='\[\e[1;1m\]' COLOR3='\[\e[m\]' GIT_STATUS=$(__git_ps1 " %s") PROMPT_CHAR="$" PROMPT="${COLOR1}\u@\h${COLOR3} \w${COLOR2}${GIT_STATUS} ${COLOR2}${PROMPT_CHAR} ${COLOR3}" PS1="$PROMPT" export PS1


2

Microsoft's Command Shell Overview gives a detailed description of where/how variables are stored. The punchline is that User vars are stored in HKCU\Environment, and System vars are in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.


1

Not sure where it was set from, but I was able to get rid of it by setting it in System Properties->Advanced->Environment Variables to "c:\". I then could select it from the list and click delete. Afterward it was gone from my command prompt.


1

As far as I'm aware, UAC doesn't ever remember answers in this way. I suspect your theory is correct, in that the first use of a feature prompted its installation and, hence, a UAC prompt. Perhaps the CRM took the failure as an indication not to prompt again. As a test, temporarily disable UAC to see if it makes a difference. Otherwise, you might have to ...


1

The -h argument controls printing of hostname at login prompt: -h Disables the printing of host-specific information before login has been completed. You should add this option to corresponding line in your /etc/inetd.conf, like: telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd telnetd -h


1

Anyone working with this issue, here is the example that worked for me: BEFORE: export PS1="\033[0;33m[\u@\h]\033[1m\e[m \w \033[36m[>>]\033[0m\e[m " AFTER: export PS1='\[\033[0;34m\][\u@\h]\[\033[1m\e[m\] \w \[\033[35m\][>>]\[\033[0m\e[m\] ' Notes all the '\\[\\]' around the colors.


1

In zsh, you have vared: % foo=wibble % vared foo wibble and the cursor is then at the end of the wibble, you can edit as you like and when you press enter, you've defined the new value of foo.


1

Try using processmon (www.sysinternals.com) to capture the issue and find out where the access denied is coming from. If you add a filter for the PID of your site's app pool you won't have too many events. Type iisapp from the command prompt to see the app pool to PID mapping. After you get a capture, search for the word 'denied'. It's likely that ...



Only top voted, non community-wiki answers of a minimum length are eligible