Colored Bash

Hey. So right now in my .bashrc I'm using the following lines to color my bash prompt:
PS1='\[\e[1;35m\]\u\[\e[m\] \[\e[1;34m\]\W\[\e[m\] \[\e[1;31m\]> \[\e[0;37m\]'
PS2='>'
so my normal text atm is white, but I'd really love to have it just as my default system text color. The problem is if I reset it with 'tput sgr0' then I have some strange problems. any other way to reset it?

Stythys wrote:
Hey. So right now in my .bashrc I'm using the following lines to color my bash prompt:
PS2='>'
so my normal text atm is white, but I'd really love to have it just as my default system text color. The problem is if I reset it with 'tput sgr0' then I have some strange problems. any other way to reset it?
PS1='\[\e[1;35m\]\u\[\e[m\] \[\e[1;34m\]\W\[\e[m\] \[\e[1;31m\]> \[\e[0;37m\]'
                                                                                                        ^--------^ This part is turning it white.
What color do you want it?

Similar Messages

  • [SOLVED]Color Bash Prompt help

    So I have been customizing my arch box and everything has been great except for one problem; the bash color prompt. I am kind of running a color screen where I am using the same shade of green, blues, grays, etc. I would like to continue that with my bash color prompt. However it seems to use some weird numbering system for its colors that I am not familiar with. I know that there is a way to use 256 colors, but I am not sure how.
    So for example I would like to have this shade of green from bash  0;32m' as this #87d75f  in html notation.
    Is there a way for this to be done? Thanks.
    Last edited by NoxSec (2011-07-15 20:52:08)

    The prompt inherits colours from those specified in .Xresources https://wiki.archlinux.org/index.php/Xresources

  • Color Bash prompt Wiki needs editing [SOLVED]

    Howdy archers
    I didn't know where else or who I should contact for this....
    but I found something that "may" need editing on this part of the wiki     http://wiki.archlinux.org/index.php/Color_Bash_Prompt
    the part where it says     * Edit root's Bash file; copy it from /etc/skel if the file is not present:
    # nano /root/.bash_profile
    I tried this over and over again with no luck... then I figured out that the info on the wiki was incorrect... you are not suppose
    copy ".bash_profile" to /root     you are suppose to copy    ".bashrc" over to /root and add what you want in it... otherwise
    no changes take effect
    cheers
    Last edited by kaddy (2010-05-26 09:24:36)

    oh yeah... I forgot anybody can edit the arch wiki... will do

  • [SOLVED] Color Bash Prompt - Arch Latest News w/o description

    Hi everybody, i'm trying to get the Arch Latest News in the bash profile when terminal starts. I followed the wiki https://wiki.archlinux.org/index.php/Co … s_at_logon and I can show the latest news without problems. What I want to do is to show only the titles and links, without description, that uses much space in the terminal. I tried to figure out what lines I should delete in the /etc/bash.bashrc file but.. you know the sintax is pretty obscure for the most of us (at least for me). I see that there is a description line.. but, really I can't manage this. How can I do this? Thanks in advance.
    Last edited by crixus-ita (2013-01-17 13:42:43)

    Here's one way of doing it:
    echo -e "$(echo $(curl --silent https://www.archlinux.org/feeds/news/ | sed -e '
    :a;N;$!ba;s/\n/ /g') | \
    sed -e 's/&/\&/g
    s/&lt;\|&#60;/</g
    s/&gt;\|&#62;/>/g
    s/<\/a>/£/g
    s/href\=\"/§/g
    s/<title>/\\n\\n\\n :: \\e[01;31m/g; s/<\/title>/\\e[00m ::\\n/g
    s/<link>/ [ \\e[01;36m/g; s/<\/link>/\\e[00m ]/g
    s/<description>/\\n\\n\\e[00;37m/g; s/<\/description>/\\e[00m\\n\\n/g
    s/<p\( [^>]*\)\?>\|<br\s*\/\?>/\n/g
    s/<b\( [^>]*\)\?>\|<strong\( [^>]*\)\?>/\\e[01;30m/g; s/<\/b>\|<\/strong>/\\e[00;37m/g
    s/<i\( [^>]*\)\?>\|<em\( [^>]*\)\?>/\\e[41;37m/g; s/<\/i>\|<\/em>/\\e[00;37m/g
    s/<u\( [^>]*\)\?>/\\e[4;37m/g; s/<\/u>/\\e[00;37m/g
    s/<code\( [^>]*\)\?>/\\e[00m/g; s/<\/code>/\\e[00;37m/g
    s/<a[^§|t]*§\([^\"]*\)\"[^>]*>\([^£]*\)[^£]*£/\\e[01;31m\2\\e[00;37m \\e[01;34m[\\e[00;37m \\e[04m\1\\e[00;37m\\e[01;34m ]\\e[00;37m/g
    s/<li\( [^>]*\)\?>/\n \\e[01;34m*\\e[00;37m /g
    s/<!\[CDATA\[\|\]\]>//g
    s/\|>\s*<//g
    s/ *<[^>]\+> */ /g
    s/[<>£§]//g
    ')\n\n" | grep -E "^( :| \[)";
    The change is the addition of the grep command at the very end.

  • Pkgman - a bash script for local package and PKGBUILD management

    hi all,
    here is a script which manages a local repository and lets you edit
    PKGBUILDs and other related files, automatically generates checksums,
    build packages, add them to your local repo and so on.
    it also has AUR support for submitting tarballs, leaving comments, etc.
    get it from here:
    http://sourceforge.net/projects/pkgman/
    and AUR package:
    http://aur.archlinux.org/packages.php?ID=17100
    you need abs, curl and pacman and optionally namcap and desktop-file-utils.
    RTFM online:
    http://sourceforge.net/apps/mediawiki/p … n_man_page
    first of all copy the pkgman.conf and AUR.conf files from /usr/share/pkgman to ~/.config/pkgman/  or ${XDG_CONFIG_HOME}/pkgman - if ${XDG_CONFIG_HOME} is set,
    edit these two files and then run
    pkgman --runmefirst
    pkgman doesn´t install anything. if you want it just builds the package and moves it to your local repository. install it then with pacman.
    it also has no dependency handling. there are many other tools which provide this.
    the main intention was to keep track of package versions, different PKGBUILD versions and own AUR submitted tarballs; also to keep a clean local repository and clean build directories.
    pkgman is stable now. i´m using it for months without any issues.
    however, if there are problems or feedback please post them here.
    vlad
    changelog:
    version 2.4:
           *pkgman now respects the PKGDEST and SRCDEST variables from makepkg.conf. (though it still moves the src.tar.gz and .pkg.tar.gz to package backup directory).
    version 2.5:
           *pkgman uses PKGDEST if SRCDEST not set in makepkg.conf.
    version 2.6 -> r26:
           *changed version system: version 2.6 is now r26!
           *minor changes: > pkgman uses now the $SHELL variable.
                                    > new and more comprehensible manpage description (thanks to bender02)
    version r27:
           *changed SRCDEST since it's only a cache dir. all files (pkg.tar.gz and src.tar.gz) go to PKGDEST.
    version r28:
           *added new variable ShellCommand to pkgman.conf. Default is $SHELL.
           *One might use an external application (like screen or xterm) to switch to build directory and edit files simultaneously.
    version r30:
           *minor changes. nothing crucial
    r32: *OverwriteExistingPackage isn't used anymore. one can delete it from ~/.config/pkgman/pkgman.conf.
           *minor changes
    version r33:
           *"-l|--list" also shows installed package version and available ABS/AUR PKGBUILD version for given package.
           *"-a|--abs" can now also be used with other options (like "-e")
    r39: * when backing up src.tarballs it asks whether to backup the source file or not
           * more detailed "--list" option - also shows if package is installed or not and available ABS/AUR version
           * added prompt to clean up directory after makepkg
           * when checking pkg.tar.gz also possibility to check for conflicts with files of already installed packages
           * use $PAGER instead of less
           * --help directly shows the manpage
           * --shorthelp shows a brief usage overview
           * added a custom prompt, but only when using bash (is somehow experimental - works fine here for me)
           * minor internal changes
           * pkgman also reads ~/.aurvote file for getting aur name and password. if one already uses aurvote then there is no need for the
             ~/.config/pkgman/AUR.conf file.
    r40: * new manual page & rewrite of usage function
           * both option "--flush" and "--flushall" were omitted in favor of the more versatile "--cleanup" option
           * pkgman <packagename> checks now if <packagename> is owned by user
           * backup option after each editing
           * added license
           * minor internal changes
    r41: * just small bug fixes, nothing crucial.
    r42: * more bugs fixed.
    r45: * new options added:
              >   --listversions: list local and available versions of installed packages from LocalPackages directory
              >  --getownpackages: synchronize local own packages with AUR
           * added new variable in pkgman.conf:
              > ListOutputInPager: output of, for example, "--list" or "--own" is piped into $PAGER
           * added a new optional dependency "desktop-file-utils" for validating desktop entry files
           * also supports now auto-generation of sha sums not only md5
           * internal fixes due to AUR interface changes:
              > use of json interface
              > correct parsing of package category
           * added 2 proto files (located under /usr/share/pacman):
              >  proto.desktop: a template for *.desktop files
              > PKGBUILD-lib32.proto: a template for lib32 packages for x86_64
           * some code changes and fixes
    r46: * added new option to pkgman.conf (AutoGenerateSums).
             > if AutoGenerateSums=no then pkgman asks whether to generate checksums or not.
             > if set to yes it behaves like in former versions.
    r52: * "--getownpackages" with more than 100 packages works again
           * added new option "--cachecopy":
              For each package in CacheCopyList (new variable in pkgman.conf) get existing package from pacman's cache directory - if
              CopyPkgFromCache (new variable in pkgman.conf) is set to yes - and/or create a source tarball of PKGBUILD and related files from ABS -
              if CopySrcFromABS (new variable in pkgman.conf) is set to yes - and copy them to package backup directory.
           * added new variables to pkgman.conf:
               > "CacheCopyList=file" - batch backup file, one package per line - default location is "$HOME/.config/pkgman/package.list".
               > "CopySrcFromABS=[yes|no]"
               > "CopyPkgFromCache=[yes|no]"
           * some bugfixes
           * docs completed
           * CacheCopyList should look like
    package1
    package2
    #this is a comment
    ! this too
    package3
    !package4
    r54: * renamed "--listversions" option to "--diffversions". makes more sense!
              from the man page:
                  pkgman --diffversions
                  Show differing ABS/AUR versions of installed packages from LocalPackages.
    r55: * minor changes.
    r57: * testing release
           * added a new option "--rollback":
               "pkgman <packagename> --rollback" - checks  http://arm.kh.nu for available package versions,
                                                          lets you choose one, fetches the package and
                                                          moves it to the <packagename> backup directory (if "--repoadd" is used).
    r59: * stable release
           * new option "--rollback" (see r57):
                   it checks http://arm.kh.nu (Arch Rollback Machine) for available package versions,
                   downloads chosen file and moves it to local repository (if "-r|--repoadd"  is used).
            * posting files/comments/etc to AUR should work now again.
    r65: *stable release
           * new option "-M,--meta" to create metapackages and add them and their dependencies to local repository.
              it searches for deps inside the backup directories, pacman's cache and if the packages are not available, it tries to fetch the missing
              dependencies from the Arch Rollback Machine site (http://arm.kh.nu).
    r66: * minor fixes
    r68: * some bugfixes
           * "--repoadd" and "--Reporemove" now accurately removes old packages from LocalRepository
    r69: * small bugfixes when listing packages with similar names
           * curl retries now 5 times if connection is not established
    r75: * "--cachecopy" does not try to dl sourcefiles when backing up ABS PKGBUILDs
           * some work on package splitting
           * further internal changes
    r76: * minor mistakes with "ln" purged
    r79: * mostly small changes
           * "--cleanup" now also removes uninstalled packages from LocalRepository
    r81 & r80: * added AUR v1.6.0 support (use more json)
                    * small ARM changes ("--rollback")
    r85:
          * pkgman supports pkg.tar.xz packages
          * some code rewrite, bugs purged (hopefully)
    r113:
          * pkgman now supports building split packages through makepkg.
             If you already use pkgman you need to rerun "pkgman --runmefirst" after updating.
          * new  "-t,--template" option ("pkgman <packagename> --template <alt. packagename> [--pkgbuildversion <version>] [options]").
             Useful to create a new PKGBUILD and use an existing one as a template.
          * new option: "--conf /path/to/alternate/conf/file" - Specify another configuration file.
          * pkgman now uses ${XDG_CONFIG_HOME}/pkgman or $HOME/.config/pkgman - if first not set - as the default location for its conf files.
    r116:
          * check inet conection when submitting src tarballs to AUR
          * some bugs
          * updated manpage on sf
    For further details please read the manual page.
    Last edited by DonVla (2010-04-28 11:56:59)

    I'm having some troubles with it (perhaps missing dependencies, and forgotten hardcoded dirs?):
    jan@aconcagua 8:20PM ~ % pkgman --runmefirst
    /usr/bin/pkgman: line 77: /home/jan/apps/skripte/archscripts/pkgman/share/pkgman/color.bash: No such file or directory
    /usr/bin/pkgman: line 1293: initcolor: command not found
    /usr/bin/pkgman: line 312: highlight: command not found
    /usr/bin/pkgman: line 312: error: command not found
    /usr/bin/pkgman: line 313: highlight: command not found
    /usr/bin/pkgman: line 313: error: command not found
    /usr/bin/pkgman: line 314: highlight: command not found
    /usr/bin/pkgman: line 314: error: command not found
    /usr/bin/pkgman: line 315: highlight: command not found
    /usr/bin/pkgman: line 315: error: command not found
    /usr/bin/pkgman: line 317: error: command not found
    /usr/bin/pkgman: line 318: error: command not found
    /usr/bin/pkgman: line 321: highlight: command not found
    /usr/bin/pkgman: line 321: msg: command not found
    /usr/bin/pkgman: line 329: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    touch: cannot touch `/bin/.pkgman.registered': Permission denied
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 337: msg: command not found
    curl: option --output: requires parameter
    curl: try 'curl --help' or 'curl --manual' for more information
    ^C/usr/bin/pkgman: line 209: cleanoutput: command not found
    /usr/bin/pkgman: line 209: cleanoutput: command not found
    (I terminated with ctrl-c).
    EDIT: errors resolved by correcting the path $HOME/apps/skripte/archscripts/pkgman/share/pkgman to /usr/share/pkgman in the pkgman itself.
    Last edited by bender02 (2008-05-23 01:28:58)

  • Installation problem with Siebel8.0 on Oracle Enterprise Linux 4 system

    We are having installation problem with Siebel8.0 on Oracle Enterprise Linux 4 system.
    Using interface, when installation come up to “Installing Wizard” window where Gateway Name Server Configuration window should take place, everything just freeze up
    Using console, after installation we obtain following errors:
    Installing Siebel Enterprise Server. Please wait...
    unable to launch: "ksh export
    LD_LIBRARY_PATH=/siebel/gtwysrvr/lib;PATH=${PATH}:.;/root/istemp8058094162222/_bundledJRE_/bin/java
    -Dtemp.dir=/root -cp /siebel/gtwysrvr/bin/setup.jar run -args LANG=ENU
    MODE=LIVE MODEL_FILE=/siebel/gtwysrvr/admin/enterprise_console.scm" error code:
    "236"(SBL-STJ-00152)
    LD_LIBRARY_PATH=/siebel/siebsrvr/lib;PATH=${PATH}:.;/root/istemp8058094162222/_bundledJRE_/bin/java
    -Dtemp.dir=/root -cp /siebel/siebsrvr/bin/setup.jar run -args LANG=ENU
    REPEAT=FALSE MODE=LIVE MODEL_FILE=/siebel/siebsrvr/admin/siebel_server.scm"
    error code: "236"(SBL-STJ-00152)
    LD_LIBRARY_PATH=/siebel/siebsrvr/mgmtagent/lib;PATH=${PATH}:.;/root/istemp8058094162222/_bundledJRE_/bin/java
    -Dtemp.dir=/root -cp /siebel/siebsrvr/mgmtagent/bin/setup.jar run -args
    LANG=ENU MODE=LIVE
    MODEL_FILE=/siebel/siebsrvr/mgmtagent/admin/mgmtagent_ses.scm" error code:
    "236"(SBL-STJ-00152)
    Running command :
    ./ssincfgw -is:javaconsole -console -args LANG=ENU MODE=LIVE MODEL_FILE=/siebel/gtwysrvr/admin/enterprise_console.scm
    Infinite loop of following error pops out:
    An error occurred during wizard bean change notification:
    java.lang.NoClassDefFoundError
    at ConfigInitialize.execute(ConfigInitialize.java:21)
    at com.installshield.wizard.StandardWizardListener.execute(StandardWizardListener.java:123)
    Is there any clue how this error can be solved??
    Thanks in advance!!
    Gordon
    Message was edited by:
    user605023

    I'm facing the same error message while install Siebel 8.0 on OEL. But before I had this ksh problem, it complains about disc space first, and I actually has plenty of disk space under the directory (it needs only 0.7 G and I have 17G free). Anybody has encountered such problem before?
    /net/sdcnas05/vol/engfs01/v_sia/8.0SIA[20405|http://forums.oracle.com/forums/]/Release/Linux/Server/Siebel_Enterprise_Server
    -bash-3.00$ ./setuplinux -is:javaconsole -console
    Initializing InstallShield Wizard........
    Initializing InstallShield Wizard........
    Launching InstallShield Wizard........
    0% 25% 50% 75% 100%
    Welcome to the InstallShield Wizard for Siebel Enterprise Server
    The InstallShield Wizard will install Siebel Enterprise Server on your
    computer.
    To continue, choose Next.
    Siebel Enterprise Server
    Siebel Systems
    Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]
    Siebel Enterprise Server Install Location
    Please specify a directory or press Enter to accept the default directory.
    Directory Name: [siebel] /slot/ems1115/appmgr/20405
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    Please select the products you wish to install.
    [ ] 1 - Gateway Name Server
    [ ] 2 - Siebel Server
    [ ] 3 - Database Configuration Utilities
    [ ] 4 - EAI Connectors
    To select an item enter its number, or 0 when you are finished: [0]: 1
    [X] 1 - Gateway Name Server
    [ ] 2 - Siebel Server
    [ ] 3 - Database Configuration Utilities
    [ ] 4 - EAI Connectors
    To select an item enter its number, or 0 when you are finished: [0]: 2
    [X] 1 - Gateway Name Server
    [X] 2 - Siebel Server
    [ ] 3 - Database Configuration Utilities
    [ ] 4 - EAI Connectors
    To select an item enter its number, or 0 when you are finished: [0]:
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    Configuring uninstallers. Please wait...
    0% 25% 50% 75% 100%
    Choose the setup type that best suits your needs.
    [X] 1 - Typical
    [ ] 2 - Compact
    [ ] 3 - Custom
    To select an item enter its number, or 0 when you are finished: [0]
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    Please select the languages you wish to install.
    [X] 1 - enu - English (American)
    [ ] 2 - fin - Finnish
    [ ] 3 - kor - Korean
    [ ] 4 - cht - Chinese (Traditional)
    [ ] 5 - ita - Italian (Standard)
    [ ] 6 - esn - Spanish (Modern)
    [ ] 7 - deu - German (Standard)
    [ ] 8 - chs - Chinese (Simplified)
    [ ] 9 - tha - Thai
    [ ] 10 - dan - Danish
    [ ] 11 - heb - Hebrew
    [ ] 12 - fra - French (Standard)
    [ ] 13 - nld - Dutch (Standard)
    [ ] 14 - ptb - Portuguese (Brazilian)
    [ ] 15 - csy - Czech
    [ ] 16 - jpn - Japanese
    [ ] 17 - ptg - Portuguese (Standard)
    [ ] 18 - ara - Arabic (Sa`udi)
    [ ] 19 - sve - Swedish
    To select an item enter its number, or 0 when you are finished: [0]
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    {color:#ff0000}*Drive "/slot/ems1115/appmgr/20405" does not have enough space to install the*
    selected configuration. Please free up "766446" KB on drive
    *"/slot/ems1115/appmgr/20405" before continuing.*{color}
    -bash-3.00$ pwd
    /slot/ems1115/appmgr/20405
    -bash-3.00$ df -h .
    Filesystem Size Used Avail Use% Mounted on
    sdc1002nap-vlan1:/vol/ems_39426_1115
    71G 55G 17G 77% /slot/ems1115

  • Patch install problem in Solaris 10

    {color:#3366ff}Hi , I am trying to install patch 125100-10 to meet the requirement of our application system.But there seems something wrong. {color}
    bash-3.00# showrev -p | grep {color:#ff0000}125100{color}
    Patch: 120011-14 Obsoletes: 116781-02, 117447-01, 117463-05, 118371-10, 118373-01, 118564-03, 118731-01, 118879-02, 118890-03, 118925-05, 118929-05, 119012-03, 119073-03, 119077-10, 119265-02, 119332-01, 119336-01, 119573-02, 119580-05, 119586-02, 119593-01, 119685-11, 119824-02, 119826-02, 119981-09, 119985-02, 119998-02, 120023-01, 120032-04, 120048-03, 120050-06, 120469-07, 120473-12, 120629-08, 120780-04, 120809-01, 120824-09, 120845-05, 120990-02, 120998-02, 121006-02, 121010-06, 121215-01, 121229-02, 121235-01, 121278-01, 121282-02, 121284-02, 121288-03, 121292-01, 121294-01, 121406-01, 121473-01, 121474-01, 121476-01, 121478-01, 121786-01, 121905-01, 122251-01, 122328-01, 122404-01, 122412-01, 122513-02, 122535-01, 122637-01, 122646-02, 122658-04, 122660-10, 122662-05, 122752-04, 123017-01, 123249-02, 123256-02, 123324-03, 123330-01, 123350-01, 123354-03, 123356-02, 123362-01, 123418-02, 123420-02, 123422-03, 123441-05, 123444-01, 123910-03, 123911-01, 123916-05, 123954-01, 124204-04, 124208-01, 124250-03, 124254-04, 124258-07, 124280-01, 124286-01, 124327-04, 124442-01, 124916-03, 124918-02, 124921-02, 124922-03, 124987-02, 124990-01, 124993-01, 124995-01, 125009-01, 125011-01, 125014-03, 125018-02, 125020-01, 125024-01, 125026-01, 125028-03, 125035-01, 125040-01, 125042-02, 125073-01, 125077-03, 125079-01, {color:#ff0000}125100-10{color}, 125112-01, 125114-01, 125116-02, 125118-01, 125120-03, 125123-01, 125127-01, 125129-01, 125198-02, 125203-01, 125329-03, 125363-06, 125371-01, 125383-01, 125385-02, 125420-01, 125422-01, 125424-01, 125427-01, 125430-01, 125432-01, 125465-02, 125478-01, 125486-01, 125488-02, 125492-01, 125494-02, 125497-01, 125792-01, 125795-01, 126255-01, 126303-02, 126310-01, 126320-01, 126429-01, 126536-01, 126663-01, 126838-01 Requires: 118833-36, 118918-24, 119042-09, 119254-42, 119574-02, 119578-30, 120272-12, 120900-04, 121133-02, 121901-01, 122640-05, 125369-05, 125503-02, 125547-01, 126419-01, 126897-02 Incompatibles: Packages: SUNWcsu, SUNWcsr, SUNWcsl, SUNWcnetr, SUNWkvm, SUNWcar, SUNWcakr, SUNWckr, SUNWcsd, SUNWcpcu, SUNWfmd, SUNWperl584core, SUNWperl584usr, SUNWesu, SUNWkrbu, SUNWmdb, SUNWmdbr, SUNWtoo, SUNWpiclu, SUNWcslr, SUNWaudit, SUNWib, SUNWusb, SUNWtavor, SUNWudapltu, SUNWudapltr, SUNWzfskr, SUNWzfsr, SUNWsmapi, SUNWzfsu, SUNWdoc, SUNWuksp, SUNWopenssl-libraries, SUNWwbsup, SUNWses, SUNWssad, SUNWuprl, SUNWusbu, SUNWmdr, SUNWmdu, SUNWintgige, SUNWipfh, SUNWipfr, SUNWipfu, SUNWnfsckr, SUNWnfscu, SUNWvolu, SUNWpapi, SUNWippcore, SUNWipplr, SUNWipplu, SUNWrcmdc, SUNWscpu, SUNWbcp, SUNWxcu4, SUNWxge, SUNWixgb, SUNWpl5u, SUNWbtool, SUNWarc, SUNWarcr, SUNWnfssu, SUNWdhcsu, SUNWdhcm, SUNWpmu, SUNWdmgtu, SUNWnisu, SUNWypu, SUNWzoner, SUNWatfsu, SUNWpoolr, SUNWpool, SUNWtecla, SUNWzoneu, SUNWauda, SUNWaudh, SUNWbart, SUNWcpc, SUNWcpr, SUNWpppdu, SUNWfruip, SUNWdtrc, SUNWkdcu, SUNWkey, SUNWpcu, SUNWppm, SUNWpsu, SUNWdfbh, SUNWlibsasl, SUNWlldap, SUNWdtrp, SUNWerid, SUNWhea, SUNWfss, SUNWsadmi, SUNWftdur, SUNWftduu, SUNWncar, SUNWntpu, SUNWrcapr, SUNWopenssl-include, SUNWpsm-lpd, SUNWqos, SUNWrcapu, SUNWrge, SUNWroute, SUNWslpu, SUNWsndmr, SUNWsndmu, SUNWsra, SUNWsshcu, SUNWsshdu, SUNWsshu
    {color:#3366ff}From the above information, it tells me, the 125100-10 is an old one and is replaced by 120011-14.
    First, I downlaod the patch and unpack it under /var/tmp
    bash-3.00# patchadd 125100-10
    Validating patches...
    Loading patches installed on the system...
    Done!
    Loading patches requested to install.
    Version of package SUNWcakr from directory SUNWcakr.v in patch 125100-10 differs from the package installed on the system.
    Version of package SUNWcakr from directory SUNWcakr.us in patch 125100-10 differs from the package installed on the system.
    Version of package SUNWkvm from directory SUNWkvm.us in patch 125100-10 differs from the package installed on the system.
    Done!
    The following requested patches have packages not installed on the system
    Package SUNWdcsr from directory SUNWdcsr in patch 125100-10 is not installed on the system. Changes for package SUNWdcsr will not be applied to the system.
    Package SUNWdcsu from directory SUNWdcsu in patch 125100-10 is not installed on the system. Changes for package SUNWdcsu will not be applied to the system.
    Package SUNWdrcr from directory SUNWdrcr.u in patch 125100-10 is not installed on the system. Changes for package SUNWdrcr will not be applied to the system.
    Package SUNWdrr from directory SUNWdrr.u in patch 125100-10 is not installed on the system. Changes for package SUNWdrr will not be applied to the system.
    Package SUNWdscpr from directory SUNWdscpr.u in patch 125100-10 is not installed on the system. Changes for package SUNWdscpr will not be applied to the system.
    Package SUNWefc from directory SUNWefc.u in patch 125100-10 is not installed on the system. Changes for package SUNWefc will not be applied to the system.
    Package SUNWefcl from directory SUNWefcl in patch 125100-10 is not installed on the system. Changes for package SUNWefcl will not be applied to the system.
    Package SUNWsckmr from directory SUNWsckmr in patch 125100-10 is not installed on the system. Changes for package SUNWsckmr will not be applied to the system.
    Package SUNWdrr from directory SUNWdrr.us in patch 125100-10 is not installed on the system. Changes for package SUNWdrr will not be applied to the system.
    Package SUNWefc from directory SUNWefc.us in patch 125100-10 is not installed on the system. Changes for package SUNWefc will not be applied to the system.
    Package FJSVcpcu from directory FJSVcpcu in patch 125100-10 is not installed on the system. Changes for package FJSVcpcu will not be applied to the system.
    Package FJSVhea from directory FJSVhea in patch 125100-10 is not installed on the system. Changes for package FJSVhea will not be applied to the system.
    Package FJSVmdb from directory FJSVmdb in patch 125100-10 is not installed on the system. Changes for package FJSVmdb will not be applied to the system.
    Package FJSVmdbr from directory FJSVmdbr in patch 125100-10 is not installed on the system. Changes for package FJSVmdbr will not be applied to the system.
    Checking patches that you specified for installation.
    Done!
    {color}
    {color:#000000}
    The following requested patches will not be installed because
    they have been made obsolete by other patches already
    installed on the system or by patches you have specified for installation.
    0 All packages from patch 125100-10 are patched by higher revision patches.
    {color}
    No patches to install.
    {color:#000000}
    {color}{color:#3366ff}Then I tried to install the new patch 120011-14 {color}
    {color:#000000}
    bash-3.00# patchadd 120011-14
    Validating patches...
    Loading patches installed on the system...
    Done!
    Loading patches requested to install.
    Version of package SUNWcakr from directory SUNWcakr.v in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWcar from directory SUNWcar.v in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWcpc from directory SUNWcpc.v in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWkvm from directory SUNWkvm.v in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWcakr from directory SUNWcakr.us in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWcar from directory SUNWcar.us in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWcpc from directory SUNWcpc.us in patch 120011-14 differs from the package installed on the system.
    Version of package SUNWkvm from directory SUNWkvm.us in patch 120011-14 differs from the package installed on the system.
    Done!
    The following requested patches have packages not installed on the system
    Package SUNWcart200 from directory SUNWcart200.v in patch 120011-14 is not installed on the system. Changes for package SUNWcart200 will not be applied to the system.
    Package SUNWcti2 from directory SUNWcti2.u in patch 120011-14 is not installed on the system. Changes for package SUNWcti2 will not be applied to the system.
    Package SUNWdcsr from directory SUNWdcsr in patch 120011-14 is not installed on the system. Changes for package SUNWdcsr will not be applied to the system.
    Package SUNWdcsu from directory SUNWdcsu in patch 120011-14 is not installed on the system. Changes for package SUNWdcsu will not be applied to the system.
    Package SUNWdrcr from directory SUNWdrcr.u in patch 120011-14 is not installed on the system. Changes for package SUNWdrcr will not be applied to the system.
    Package SUNWdrr from directory SUNWdrr.u in patch 120011-14 is not installed on the system. Changes for package SUNWdrr will not be applied to the system.
    Package SUNWdscpr from directory SUNWdscpr.u in patch 120011-14 is not installed on the system. Changes for package SUNWdscpr will not be applied to the system.
    Package SUNWefc from directory SUNWefc.u in patch 120011-14 is not installed on the system. Changes for package SUNWefc will not be applied to the system.
    Package SUNWefcl from directory SUNWefcl in patch 120011-14 is not installed on the system. Changes for package SUNWefcl will not be applied to the system.
    Package SUNWefcr from directory SUNWefcr in patch 120011-14 is not installed on the system. Changes for package SUNWefcr will not be applied to the system.
    Package SUNWidn from directory SUNWidn.u in patch 120011-14 is not installed on the system. Changes for package SUNWidn will not be applied to the system.
    Package SUNWiopc from directory SUNWiopc.v in patch 120011-14 is not installed on the system. Changes for package SUNWiopc will not be applied to the system.
    Package SUNWkvmt200 from directory SUNWkvmt200.v in patch 120011-14 is not installed on the system. Changes for package SUNWkvmt200 will not be applied to the system.
    Package SUNWldomr from directory SUNWldomr.v in patch 120011-14 is not installed on the system. Changes for package SUNWldomr will not be applied to the system.
    Package SUNWldomu from directory SUNWldomu.v in patch 120011-14 is not installed on the system. Changes for package SUNWldomu will not be applied to the system.
    Package SUNWpcmci from directory SUNWpcmci in patch 120011-14 is not installed on the system. Changes for package SUNWpcmci will not be applied to the system.
    Package SUNWsckmr from directory SUNWsckmr in patch 120011-14 is not installed on the system. Changes for package SUNWsckmr will not be applied to the system.
    Package SUNWus from directory SUNWus.u in patch 120011-14 is not installed on the system. Changes for package SUNWus will not be applied to the system.
    Package SUNWust1 from directory SUNWust1.v in patch 120011-14 is not installed on the system. Changes for package SUNWust1 will not be applied to the system.
    Package SUNWwrsm from directory SUNWwrsm.u in patch 120011-14 is not installed on the system. Changes for package SUNWwrsm will not be applied to the system.
    Package SUNWdrr from directory SUNWdrr.us in patch 120011-14 is not installed on the system. Changes for package SUNWdrr will not be applied to the system.
    Package SUNWefc from directory SUNWefc.us in patch 120011-14 is not installed on the system. Changes for package SUNWefc will not be applied to the system.
    Package FJSVcpcu from directory FJSVcpcu in patch 120011-14 is not installed on the system. Changes for package FJSVcpcu will not be applied to the system.
    Package FJSVhea from directory FJSVhea in patch 120011-14 is not installed on the system. Changes for package FJSVhea will not be applied to the system.
    Package FJSVmdb from directory FJSVmdb in patch 120011-14 is not installed on the system. Changes for package FJSVmdb will not be applied to the system.
    Package FJSVmdbr from directory FJSVmdbr in patch 120011-14 is not installed on the system. Changes for package FJSVmdbr will not be applied to the system.
    Package FJSVpiclu from directory FJSVpiclu in patch 120011-14 is not installed on the system. Changes for package FJSVpiclu will not be applied to the system.
    The following requested patches are already installed on the system
    Requested to install patch 120011-14 is already installed on the system.
    No patches to check dependency.
    {color}
    {color:#000000}
    {color}
    {color:#3366ff}
    I really confused by the information given by the system.Anyone can help me with it. Thanks{color}
    Edited by: hubery on Jul 6, 2008 5:04 PM

    Patch 120011-14, which obsoletes patch 125100-10, is already installed on your system. Most likely no more actions needed from your side. If your software requires exactly patch 125100-10 and is not compatible with its successor, then you can try remove patch 120011-14.

  • Basic ~/.bashrc ~/.bash_profile tips thread

    A lot of this is borrowed from other sites, including the wiki
    This by no means all-inclusive, please add on anything interesting along this topic
    About ~/.bash_profile and ~/.bashrc
    disclaimer:  I don't use ~/.bash_profile or ~/.profile
    there is plenty of documentation on the web on how to use these properly if you're interested
    in fact, my ~/.bash_profile looks like this:
    #!/bin/sh
    ### THIS IS A DUMMY FILE
    ### DON'T NEED TWO FILES TO DO ONE JOB
    ### LET'S CALL ~/.bashrc INSTEAD
    source ~/.bashrc
    Now, if you choose to go this method, there's a little trick you can do to eliminate ~/.bash_profile altogether  :twisted:
    as root create file /etc/profile.d/bashrc.sh with contents:
    #!/bin/sh
    source ~/.bashrc
    AND
    chmod +x /etc/profile.d/bashrc.sh
    Since /etc/profile executes everything in /etc/profile.d/ that is chmod executable, the little script we just created will cause ~/.bashrc to be read on every login... I personally prefer this method to the dummy ~/.bash_profile, but I keep both since I share my /home directory across distributions and not all distros are the same.
    Now, on to the actual ~/.bashrc:
    #!/bin/sh
    ### ALIASES
    alias ls="ls --color"
    alias ll="ls --color -lh"
    alias la="ls --color -a"
    alias pacs="pacsearch"
    alias vim="vim -y"
    alias nano="nano -w"
    ### NICE COLOR BASH PROMPT
    function bash_prompt
    local WHITE="[33[1;37m]"
    local default="[33[0;39m]"
    local BRIGHTGREEN="[33[1;32m]"
    local GREEN="[33[0;32m]"
    local CYAN="[33[0;36m]"
    local GRAY="[33[0;37m]"
    local RED="[33[0;31m]"
    if [ `id -u` != "0" ]; then
    PS1="${GREEN}u${CYAN}@${GREEN}h ${CYAN}w${WHITE} ${default}$ "
    else
    PS1="${RED}u${CYAN}@${GREEN}h ${CYAN}w${WHITE} ${default}$ "
    fi
    bash_prompt
    ### COLORIZE PACMAN (PACS)
    pacsearch () {
    echo -e "$(pacman -Ss $@ | sed
    -e 's#current/.*#\033[1;31m&\033[0;37m#g'
    -e 's#extra/.*#\033[0;32m&\033[0;37m#g'
    -e 's#community/.*#\033[1;35m&\033[0;37m#g'
    -e 's#^.*/.* [0-9].*#\033[0;36m&\033[0;37m#g' )"
    This is really pretty basic.  I use the same ~/.bashrc for all users, including root...
    The alias section is pretty self explanatory, basically the parts in quotations (" ") get run instead of the commands before the equals (=) in every case.
    The bash prompt section is a bit nifty.  The first part, with color definitions, is so that I don't go mad trying to write the actual PS1 line.  Makes it cleaner in my opinion.  There's lots of documentation out there if you're interested in modifying the prompt I have.
    The if/then/else statement in the bash prompt section checks if the user is root.  If not, the username is displayed in GREEN at the prompt.  If the user is root, the username is displayed in RED.  A nice visual reminder, and since I use my ~/.bashrc for ALL users, including root, it helps make the file more portable.
    The last section is taken straight from the Arch wiki.  At the top I aliased 'pacs', which calls this section.  Basically 'pacs' can take the place of 'pacman -Ss' and offer simple colour output.
    http://wiki.archlinux.org/index.php/Col … man_output
    Additions, other bash tips & tricks, comments, all welcome

    I added some comments explaining each piece.
    Misc stuff:
    # My prompt, quite basic, decent coloring, shows the value of $?
    # (exit value of last command, useful sometimes):
    C_DEFAULT="[33[0m]"
    C_BLUE="[33[0;34m]"
    export PS1="$C_BLUE($C_DEFAULT$?$C_BLUE)[$C_DEFAULTu$C_BLUE@$C_DEFAULTh$C_BLUE:$C_DEFAULTw$C_BLUE]\$ $C_DEFAULT"
    export PS2="$C_BLUE> $C_DEFAULT"
    # If you allow Ctrl+Alt+Backspace to kill the X server but are paranoid,
    # then this alias will ensure that there will be no shell open afterwards.
    alias startx="exec startx"
    # Let grep colorize the search results
    alias g="egrep --color=always"
    alias gi="egrep -i --color=always"
    # Hostname appended to bash history filename
    export HISTFILE="$HOME/.bash_history_`hostname -s`"
    # Don't save repeated commands in bash history
    export HISTCONTROL="ignoredups"
    # Confirm before overwriting something
    alias cp="cp -i"
    # Disable ^S/^Q flow control (does anyone like/use this at all?)
    stty -ixon
    # If your resolution gets fucked up, use this to reset (requires XRandR)
    alias resreset="xrandr --size 1280x1024"
    And some small but handy functions:
    # mkmv - creates a new directory and moves the file into it, in 1 step
    # Usage: mkmv <file> <directory>
    mkmv() {
    mkdir "$2"
    mv "$1" "$2"
    # sanitize - set file/directory owner and permissions to normal values (644/755)
    # Usage: sanitize <file>
    sanitize() {
    chmod -R u=rwX,go=rX "$@"
    chown -R ${USER}.users "$@"
    # nh - run command detached from terminal and without output
    # Usage: nh <command>
    nh() {
    nohup "$@" &>/dev/null &
    # run - compile a simple c or cpp file, run the program, afterwards delete it
    # Usage: run <file> [params]
    run() {
    filename="${1%%.*}"
    extension="${1##*.}"
    file="$1"
    shift
    params="$@"
    command=""
    if [ $extension = "cc" -o $extension = "cpp" -o $extension = "c++" ]; then
    command="g++"
    elif [ $extension = "c" ]; then
    command="gcc"
    else
    echo "Invalid file extension!"
    return 1
    fi
    $command -Wall -o $filename $file
    chmod a+x $filename
    ./$filename $params
    rm -f $filename 2>/dev/null

  • [SOLVED] Bash changes consolle's colors by itself

    Hi archers,
    I've wrote a little script which ask for the result of a given random moltiplication because I was exercising with $RANDOM and something strange's happend.
    No matter where I am (Tty, Tmux, Urxvt, Xterm...) Bash changes consolle's colors by itself if I do ^c to stop the script, instead of write a reply.
    i.e.'s:
    correct behaviour
    $ 8 * 9 = ?
    $ 72
    $ ls
    file in red file in yellow file in grey...
    Wrong behaviour
    $ 8 *9 = ?
    $ ^c
    $ ls
    file in blue file in green file in white...
    What the heck?
    Bash version is 4.2.39(2)-release.
    The script is the following:
    while :
    do
    min="3"
    max="7"
    fat1="$(($RANDOM%$max+$min))"
    fat2="$(($RANDOM%$max+$min))"
    prod="$(($fat1*$fat2))"
    echo "$fat1 * $fat2 = ?"
    read res
    while [ "$res" != "$prod" ]
    do
    echo "$prod"
    echo "Insert the correct result."
    tavPit
    done
    return 0
    done
    Everything is up to date.
    .bashrc
    [[ $- != *i* ]] && return
    complete -cf sudo
    [ -f /etc/bash_completion ] && ! shopt -oq posix && . /etc/bash_completion
    [ -f ~/.bash/include ] && . ~/.bash/include
    [ -e "$HOME"/.dircolors ] && eval $(dircolors -b "$HOME"/.dircolors)
    include
    #!/bin/bash
    [ -f ~/.bash/alias ] && . ~/.bash/alias
    [ -f ~/.bash/color ] && . ~/.bash/color
    [ -f ~/.bash/export ] && . ~/.bash/export
    [ -f ~/.bash/shopt ] && . ~/.bash/shopt
    [ -f ~/.bash/stty ] && . ~/.bash/stty
    [ -f ~/.bash/set ] && . ~/.bash/set
    color
    nc="\e[0m"
    nbk="\e[0;30m"
    nre="\e[0;31m"
    ngr="\e[0;32m"
    nye="\e[0;33m"
    nbl="\e[0;34m"
    nma="\e[0;35m"
    ncy="\e[0;36m"
    nwh="\e[0;37m"
    bbk="\e[1;30m"
    bre="\e[1;31m"
    bgr="\e[1;32m"
    bye="\e[1;33m"
    bbl="\e[1;34m"
    bma="\e[1;35m"
    bcy="\e[1;36m"
    bwh="\e[1;37m"
    end="\[\e[m\]"
    man() {
    env \
    LESS_TERMCAP_mb=$(printf "\e[0;32m") \
    LESS_TERMCAP_md=$(printf "\e[0;32m") \
    LESS_TERMCAP_me=$(printf "\e[0m") \
    LESS_TERMCAP_se=$(printf "\e[0m") \
    LESS_TERMCAP_so=$(printf "\e[1;31m") \
    LESS_TERMCAP_ue=$(printf "\e[0m") \
    LESS_TERMCAP_us=$(printf "\e[1;33m") \
    man "${@}"
    if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0000000" # Black.
    echo -en "\e]P9ff0000" # Red.
    echo -en "\e]PA00ff00" # Green.
    echo -en "\e]PBffff00" # Yellow.
    echo -en "\e]PC2b4f98" # Blue.
    echo -en "\e]PDff00ff" # Magenta.
    echo -en "\e]PE00ffff" # Cyan.
    echo -en "\e]PFffffff" # White.
    clear
    fi
    .dircolors
    TERM linux
    TERM linux+utf8
    TERM rxvt-unicode
    TERM rxvt-unicode-256color
    TERM screen
    TERM screen-256color
    TERM xterm
    TERM putty
    EIGHTBIT 1
    NORMAL 01;30
    FILE 01;30
    DIR 31
    LINK 36
    FIFO 03;33
    SOCK 03;33
    DOOR 32
    BLK 32
    CHR 32
    ORPHAN 05;33
    EXEC 33
    .tar 31
    .tgz 31
    .arj 31
    .taz 31
    .lzh 31
    .zip 31
    .7z 31
    .z 31
    .Z 31
    .gz 31
    .bz2 31
    .deb 31
    .rpm 31
    .jar 31
    .rar 31
    .xz 31
    .jpg 35
    .jpeg 35
    .gif 35
    .bmp 35
    .pbm 35
    .pgm 35
    .ppm 35
    .tga 35
    .xbm 35
    .xpm 35
    .tif 35
    .tiff 35
    .png 35
    .fli 35
    .gl 35
    .dl 35
    .xcf 35
    .xwd 35
    .pdf 35
    .ogg 34
    .mp3 34
    .wav 34
    .mov 34
    .mpg 34
    .mpeg 34
    .asf 34
    .avi 34
    .mkv 34
    .wmv 34
    .ogm 34
    .C 37
    .H 37
    .c 37
    .h 37
    .cxx 37
    .hxx 37
    .cpp 37
    .hpp 37
    .py 37
    .sh 37
    .vim 37
    .o 37
    .so 37
    .a 37
    .ko 37
    .rc 36
    *rc 36
    Thanks a lot.
    Last edited by rix (2012-11-26 15:38:28)

    Bandit Bowman wrote:My colours are unaffected after running the function. [...]
    Here colors change when I send SIGINT to a running instance of my script; as said before.
    Bandit Bowman wrote:[...] What does $LS_COLORS look like before and after? [...]
    When everything is working right:
    $ echo $LS_COLORS
    $ no=01;30:fi=01;30:di=31:ln=36:pi=03;33:so=03;33:do=32:bd=32:cd=32:or=05;33:ex=33:
    *.tar=31:*.tgz=31:*.arj=31:*.taz=31:*.lzh=31:*.zip=31:*.7z=31:*.z=31:*.Z=31:*.gz=31:
    *.bz2=31:*.deb=31:*.rpm=31:*.jar=31:*.rar=31:*.xz=31:*.jpg=35:*.jpeg=35:*.gif=35:
    *.bmp=35:*.pbm=35:*.pgm=35:*.ppm=35:*.tga=35:*.xbm=35:*.xpm=35:*.tif=35:*.tiff=35:
    *.png=35:*.fli=35:*.gl=35:*.dl=35:*.xcf=35:*.xwd=35:*.pdf=35:*.ogg=34:*.mp3=34:
    *.wav=34:*.mov=34:*.mpg=34:*.mpeg=34:*.asf=34:*.avi=34:*.mkv=34:*.wmv=34:*.ogm=34:
    *.C=37:*.H=37:*.c=37:*.h=37:*.cxx=37:*.hxx=37:*.cpp=37:*.hpp=37:*.py=37:*.sh=37:
    *.vim=37:*.o=37:*.so=37:*.a=37:*.ko=37:*.rc=36:*rc=36:
    When texts change color (the strange behaviour):
    $ echo $LS_COLORS
    $
    Bandit Bowman wrote:[...] Is this the whole script or just a snippet [...]
    Whole.
    Bandit Bowman wrote:[...] because I don't see anything that should modify it. [...]
    That's why I'm asking.
    Bandit Bowman wrote:[...] here's a slightly more straightforward version [...]
    Thanks, I've learnt something.
    Bandit Bowman wrote:[...] although it won't help with the colours.
    Thanks for the reply anyway.
    Bandit Bowman wrote:[...] English: [...]
    Also, many thanks again.
    Edit: solved. "$LS_COLORS" must be set if you want colors.
    Last edited by rix (2012-11-26 15:38:06)

  • [SOLVED]Bash prompt colors different in console as opposed in terminal

    Hi
    EDIT: I have solved the problem by copying /etc/skel/.bash_profile to my home directory.
    Today i updated the system and the bash prompt is fine in my terminal (KDE Konsole or in Xterm) but not in consoles. For normal user (blue colors) i use this settings in the $HOME/.bashrc file:
    PS1='[\e[0;36m\u\e[0m@\e[0;36m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ '
    For root (red color) /root/.bashrc:
    PS1='[\e[1;31m\u\e[0m@\e[1;31m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ '
    Now, if i login in console as a normal user it doesn't display blue color but red as if i was root user. Like i said in xterm or KDE Konsole it looks just fine. The case is that consoles don't use my .bashrc file and use instead /etc/bash.bashrc file: Here is my /etc/bash.bashrc file:
    # /etc/bash.bashrc
    # If not running interactively, don't do anything
    [[ $- != *i* ]] && return
    #PS1='[\u@\h \W]\$ '
    PS1='[\e[1;31m\u\e[0m@\e[1;31m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ '
    PS2='> '
    PS3='> '
    PS4='+ '
    case ${TERM} in
    xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
    screen)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
    esac
    [ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
    export EDITOR=/usr/bin/nano
    Here is my today's update:
    [2012-07-06 08:54] upgraded linux-api-headers (3.3.8-1 -> 3.4.4-1)
    [2012-07-06 08:54] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
    [2012-07-06 08:54] Generating locales...
    [2012-07-06 08:54] en_GB.UTF-8... done
    [2012-07-06 08:54] en_GB.ISO-8859-1... done
    [2012-07-06 08:54] Generation complete.
    [2012-07-06 08:54] upgraded glibc (2.15-12 -> 2.16.0-1)
    [2012-07-06 08:54] upgraded binutils (2.22-7 -> 2.22-8)
    [2012-07-06 08:54] upgraded dbus-core (1.6.0-5 -> 1.6.2-2)
    [2012-07-06 08:54] upgraded dbus (1.6.0-1 -> 1.6.2-1)
    [2012-07-06 08:54] upgraded device-mapper (2.02.96-2 -> 2.02.96-3)
    [2012-07-06 08:54] upgraded gcc-libs (4.7.1-3 -> 4.7.1-4)
    [2012-07-06 08:54] upgraded gcc (4.7.1-3 -> 4.7.1-4)
    [2012-07-06 08:54] upgraded grep (2.12-1 -> 2.13-1)
    [2012-07-06 08:54] upgraded initscripts (2012.06.3-1 -> 2012.06.3-2)
    [2012-07-06 08:54] upgraded libpurple (2.10.4-2 -> 2.10.5-1)
    [2012-07-06 08:54] upgraded libusb-compat (0.1.4-1 -> 0.1.4-2)
    [2012-07-06 08:54] upgraded lvm2 (2.02.96-2 -> 2.02.96-3)
    [2012-07-06 08:54] upgraded mpfr (3.1.0.p10-1 -> 3.1.1-1)
    Is it a problem in yesterday's pam upgrade? Yesterday i have moved /etc/pam.d/login.pacnew to /etc/pam.d/login. I didn't backup the old file. My bad. Weird thing is also this that today my KDE session crashed (for the first time) when i have used dd to burn image on my USB.
    Last edited by Shark (2012-07-06 08:40:31)

    Procyon wrote:What you want is [ -n "$SSH_CONNECTION" ] (variable is set/nonzero length) or the opposite [ -z "$SSH_CONNECTION" ] (variable is not set/zero length)
    Thanks-- that got it.  I was missing the quotes, so it was expanding at the spaces rather than interpreting the entire thing as a string.

  • Color shell/script output in bash/zsh

    So, I wanted to have an easy way to color my script output. In zsh there is a color module, but as far as I know it does only bold for special effects. Also there are some scripts around that let you call a predefined array, but there aren't any where you can combine options easily, like both bold and italic. ansi-color comes close, but it has almost 250 lines of code and I thought it could be done more efficiently. So here's color, both in a zsh and a bash variant (the shebang and the way of defining an array being the only difference).
    Save as "color" in your path, or wrap it in a function to store in either .bashrc or .zshrc. color --help for instructions. Let me know what you think, if it has bugs or if the coding can be more efficient or better (I did this mostly as a programming exercise, it's not *that* useful.
    ZSH color
    #!/bin/zsh
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    typeset -Ag colors
    colors=( black "0" red "1" green "2" yellow "3" blue "4" magenta "5" cyan "6" white "7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up
    BASH color
    #!/bin/bash
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    declare -A colors
    colors=( [black]="0" [red]="1" [green]="2" [yellow]="3" [blue]="4" [magenta]="5" [cyan]="6" [white]="7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up

    Soemthing like this will work

  • Color in BASH?

    How do you turn on color in BASH on Solaris 10? On the Mac you set CLICOLOR=1.
    How is this done in Solaris?
    Thanks.

    May or may not be worth it. You will need to get the GNU commands to get color on file lists and the like. I tried for a little while but eventually just kept it stock. You can get color in VI by using gnu vim enhanced and editing the .vimrc file and using syntax files.

  • [Solved] ncmpcpp & Bash Colors?

    I'm posting this in the newbie corner, because I suspect that it's a really noob question.  Plus, this is my first post:
    I'm messing around with ncmpcpp, trying to get it looking nice.  I found the "post your ncmpcpp config" thread, and found a couple of configurations that I really liked... mostly because of the color schemes.  So, I tryied copying the configs linked, and the colors end up really different on my screen.
    At first I thought it was something to do with the config file, but I don't think so anymore... I've tried looking for bash color schemes, but haven't found anything that really seemed to do what I wanted.
    Example:
    See the config found in this post: linky
    Look at the linked screenshot, and compare it to what I see on my machine:
    My machine
    What I've got: rxvt-Unicode-256color, ncmpcpp.
    So, what's the stupid little detail that I'm missing?
    Last edited by d3snoopy (2010-08-29 01:18:26)

    There is a page on the Wiki detailing how you can contribute: http://wiki.archlinux.org/index.php/Getting_Involved
    You can also donate, if you would like to make a monetary contribution.
    Essentially, there are any number of avenues for you to support Arch; it depends on your skills and your enthusiasm. Read the Wiki, become as familiar as you can with the Arch Way and then lend a hand where you feel best able to help out - all and any contributions are welcomed if they are consistent with the Arch philosophy.

  • Zsh (and Bash) Backgrounds Refuse to Change Color [SOLVED]

    I'm sorry if this sounds like a stupid question, but here goes.
    I installed Arch about a week ago and decided that I wanted to change the color of the terminal. I followed the guide on the Arch Wiki, (https://wiki.archlinux.org/index.php/Color_Bash_Prompt), creating all of the necessary files and copy-and-pasting all of the given text into those files. When I restarted my terminal, nothing happened. Fed up, I tried installing Zsh + oh-my-zsh. I successfully installed the two and installed  a zsh theme, but the background color still does not change. The text color, however, changes to the appopriate colors, but the background color remains white.
    Can anyone please tell me what I'm doing wrong?
    Edit: I didn't specify, but I really don't care which terminal I end up using, just as long as the colors work.
    Last edited by Thermite (2012-12-19 01:23:20)

    zsh and bash are shells, not terminal emulators. There is no "default" terminal, if you're using Arch. You had to install a terminal emulator at some point. Or maybe if you followed the beginner's guide you're using xterm. What window manager are you using?
    There are ways to set the background color in rxvt and in xterm using your .Xresources file. Look at the wiki topic for each of those terminals for more information.
    Maybe an easier method for you would be to install a terminal emulator that has menu support, like Terminator, LXTerminal, or Sakura. Then you can just right-click in the terminal and use the menu to set the background color and opacity.
    Last edited by 2ManyDogs (2012-12-18 23:03:53)

  • [Solved] How do I get bash to be colorful like in Gentoo?

    I know that this isn't Gentoo, so yall don't need to remind me just in case you were thinking about doing that, but I also know that this IS LINUX (sorry that was a 300 reference, you know, "this is Sparta," et cetera, et cetera (Yeah, I know it was unnecessary, but I couldn't help it, the temptation was too tantalizing)) and therefore what bash can do on one Linux Box should be able to happen on, more or less, any Linux Box.
    Last edited by Boxes (2011-12-15 04:27:38)

    anonymous_user wrote:
    To the OP you may be interested in Gentoo's bashrc:
    http://www.jeremysands.com/archlinux/ge … hrc-2008.0
    Thank you, I tried searching for different kinds of terminals, but I wasn't familiar with any of the one's listed (or at least I wasn't familiar with them by name, though I might have recognized them if I had used them, though I'm not sure) except for the one that I remember having used in ArchBang, which I liked very much because it's terminal showed so much info regarding my system.
    Last edited by Boxes (2011-12-15 04:29:58)

Maybe you are looking for

  • How to transfer both original and modified images to another computer?

    Hi, I've been trying to figure out if there is a way to copy items between iPhoto libraries in two different computers. Basically I've got a desktop mac and all my digial images are sorted in the iPhoto library there. This is where I want to keep the

  • DV export problems with grid line noise on export

    On exporting in Premier Pro CC I am seeing faint grid lines across the whole picture that are not in the project timeline or the source clips - in other words looks fine in the project but not when exported out. Looks a bit like moire pattern but muc

  • Cannot open embedded font

    Have pdf on website, tried to open with Adobe Reader, get error "Cannot open embedded font CGOmega". So, I tried to open the file with Acrobat Pro 9 - same error. Client doesn't have original Word document to recreated the pdf. Any way possible to op

  • How to view hystory in PS4?

    How to view hystory in PS4? To undo changes etc....

  • SUDDENLY NOTHING IS MOVING, SONGS WON'T DRAG INTO PLAYLISTS

    I'M TRYING TO CREATE NEW PLAYLISTS AND SUDDENLY NOTHING IS MOVING. INDIVIDUAL SONGS DON'T MOVE, PLAYLISTS IN THEIR ENTIRETY DON'T MOVE. TRIED CREATING A NEW PLAYLIST FOLDER AND MOVING PLAYLISTS INTO THAT BUT NOTHING GOES. HAVE CHECK SOME SETTINGS BUT