Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Hostname nel prompt della shell

    Ciao raga, mi sono accorto che aprendo la shell, il prompt non visualizza il nome del pc, praticamente questo è quello che mi da:

    codice:
    [impulsivecron@ ~]$
    mentre io vorrei:

    codice:
    [impulsivecron@TheJocker ~]$
    Il file da modificare è /etc/.bashrc giusto?
    La distro è mandriva 2010.
    Machine: Windows 10 Home - Ubuntu 14.04 LTS

  2. #2
    max

    Silence is better than bullshit.
    @mmarcon
    jHERE, Maps made easy

  3. #3
    Ciao, grazie per la risposta, per quanto riguarda la sintassi credo di aver capito, la variabile PS1 è contenuta in bashrc, ma non capisco perchè non la legge. Ti posto il contenuto del file:

    codice:
    # /etc/bashrc
    
    # System wide functions and aliases
    # Environment stuff goes in /etc/profile
    
    # It's NOT good idea to change this file unless you know what you
    # are doing. Much better way is to create custom.sh shell script in
    # /etc/profile.d/ to make custom changes to environment. This will
    # prevent need for merging in future updates.
    
    # By default, we want this to get set.
    # Even for non-interactive, non-login shells.
    if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
    	umask 002
    else
    	umask 022
    fi
    
    # are we an interactive shell?
    if [ "$PS1" ]; then
        case $TERM in
    	xterm*)
    	    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
    	    ;;
    	screen)
    	    PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'
    	    ;;
    	*)
    	    ;;
        esac
        [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
        # You might want to have e.g. tty in prompt (e.g. more virtual machines)
        # and console windows
        # If you want to do so, just add e.g.
        # if [ "$PS1" ]; then
        #   PS1="[\u@\h:\l \W]\\$ "
        # fi
        # to your custom modification shell script in /etc/profile.d/ directory
        
        if [ -z "$loginsh" ]; then # We're not a login shell
    	# Not all scripts in profile.d are compatible with other shells
    	# TODO: make the scripts compatible or check the running shell by
    	# themselves.
    	if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
                for i in /etc/profile.d/*.sh; do
    	        if [ -r $i ]; then
    	            . $i
    	        fi
    	    done
    	    unset i
    	fi
        fi
    fi
    
    unset loginsh
    Machine: Windows 10 Home - Ubuntu 14.04 LTS

  4. #4
    Ciao, risolto. Nel file /etc/sysconfig/network, il nome del pc era preceduto dal segno $, togliendolo adesso è tutto ok. Adesso prò ho un altro problema, non mi apre più kwrite da root, non so se dipende da qualcosa che ho fatto o no. Cmq apro un altro topic .

    Ciao e grazie.
    Machine: Windows 10 Home - Ubuntu 14.04 LTS

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.