Speed up sourcing /etc/bash_completion?

$ time . /etc/bash_completion
real 0m0.774s
user 0m0.473s
sys 0m0.037s
This is with a hot cache.  And happens everytime you start a shell (see /etc/bash.bashrc)
Is there a way to speed this up? I thought there was a bugticket about this at some point, but couldn't find it back.
I thought there was a trick like loading only completion files for stuff you actually use, but google isn't very helpful.
For now I'm experimenting with backgrounding sourcing the completion, which seems to work.
edit: backgrounding doesn't seem to work so well after all.
I kept getting `bash: __git_ps1: command not found` (i use this in my $PS1), i thought it was only the first time it would show PS1, but it does it all subsequent times as well.
Last edited by Dieter@be (2010-11-22 23:28:19)

Given that /etc/bash.bashrc is a file written and provided by Arch, it should be removed from there. This file should never even consider if /etc/bash_completion is on the system. /etc/profile.d/bash_completion.sh is a file provided by upstream (bash-completion) and it should be what provides completion.

Similar Messages

  • Where to find photo shutter speed, F stop etc. in iPhoto

    When I download Nikon photos to iPhoto library I was unable to find camera information such as camera shutter speed using Get Info button from the photo I clicked. But when I export the same photo out of iPhoto to Desktop and use the Get Info dialogue, I found the shutter speed information there, so the iPhoto must have store such info somewhere.
    Question: is there an easy way to get shutter speed, F stop etc. directly from the iPhoto app without exporting the photo out of the iPhoto library?

    in iPhoto select the photo and under the photo menu ==> show extended photo info
    If you only have category titles click on the little grey triangle to the left of the category name to expand it
    LN

  • Aterm now opens with source /etc/profile

    I was in aterm when I did source /etc/profile, but now whenever I open aterm I get the results of source /etc/profile. Xterm doesn't do this, only aterm. Why is it doing this and how can I fix it?

    just add "source /etc/profile" (without the quotes) to .bashrc (thats located in ur home directory)

  • Cannot source /etc/profile from within the PKGBUILD anymore

    Hi,
    Short story: the command
    source /etc/profile
    within the build() section of my PKGBUILD now returns a build() error. It used to work before, is there a reason for this? Should it be executed in another section than build()? (Note source /etc/profile works properly in console, within the build directory)
    Long story:
    I need to use $JAVA_HOME in my PKGBUILD (to patch a lua source file with the current JDK path, which can be detected with $JAVA_HOME. Patching is done with a sed command). However, if java-environment is installed for the first time (as a makedepends) along with my package, then I need to source /etc/profile first to set the $JAVA_HOME environment variable, before being able to use it within my build() section. Otherwise it is not set yet and building fails.
    Many thanks for your help.
    Last edited by zebulon (2012-12-28 14:57:23)

    Hi,
    Many thanks for the advice. I was unclear though: I maintain the aacskeys package in AUR, not the lua package. However, the file I am patching in aacskeys is named premake.lua, used for the project file generator premake.sourceforge.net.
    I'll try your first suggestion, since this is the only one which may work without touching the system. Another alternative would be to directly source the /etc/profile.d/jdk.sh file. EDIT: nope, because there could be openjdk6.sh instead. I really need to be able to source the correct file. The maintainer of opencascade uses:
    if [ -z $JAVA_HOME ]; then
    [ -e /etc/profile.d/openjdk6.sh ] && source /etc/profile.d/openjdk6.sh
    [ -e /etc/profile.d/jdk.sh ] && source /etc/profile.d/jdk.sh
    fi
    which is efficacious but less generic.
    Besides, is it normal that we get this error code, since the Arch documentation only recommends to set LANG in /etc/locale.conf? SHould I report it as a bug or request a design change for /etc/profile.d/locale.sh there (as suggested in your (b) entry)? I am asking this because my PKGBUILD is not the only one to use this trick, and this problem breaks them all.
    Thanks.
    Last edited by zebulon (2012-12-30 06:14:58)

  • Bash 4.2.008-1 does not source /etc/bash.bashrc.local

    I don't know if this was intended change or not but it seems that /etc/bash.bashrc.local is no longer sourced by default.  All the global alias that I had set there are no longer being set.  Was /etc/bash.bashrc.local depreciated (if so where is the new place for such aliases) or is this a bug?

    Allan wrote:/etc/bash.bashrc does not source /etc/bash.bashrc.local by default.  You can either put your alias in /etc/bash.bashrc directly or do the sourcing yourself.
    Hmmm, you are right http://projects.archlinux.org/svntogit/ … 657ba94213
    Last edited by karol (2011-05-01 00:03:02)

  • Does my bashrc need to source /etc/bashrc

    In Fedora/Centos, my local .bashrc file seems to need to have a line to source global definitions:
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    On Mountain Lion and Mavericks, it appears that /etc/bashrc is always sourced whether I have a local .bashrc or not. Verified with echo statements inside various files to show me what is being executed.
    I am trying to get confirm if this is true (for both interactive shells and child processes spawned by parent process) and, if so, does it do any harm to keep the sourcing of /etc/bashrc. I'd prefer to not have to have different .bashrc files for Linux and OSX.
    Thanks in advance for any advice

    I've got my answer for an interactive earlier in this thread (or at least enough to begin figuring out what I need to do regarding interactive shells and my local .bashrc). I pretty well understand the order that things are sourced in interactive, but was unprepared for the difference of OSX /etc/profile sourcing /etc/bashrc (which doesn't seem to happen on Linux).
    As for non-interactive, I tried to do as much research before querying on this forum. I know that they just do .bashrc. Hence why I see advice (and I have long followed such) to have .bash_profile source .bashrc to have all "my stuff" in one file that both interactive and non-interactive source. However, I can not figure out whether a non-interactive / subshell inherits and/or sources /etc/bashrc (which on OSX I now know comes through /etc/profile). My sense is that it does on OSX based on the other reply I got. Which would mean that whether I need to source /etc/bashrc is the same for interactive and non-interactive since, on OSX, I get the sense that any shell, interactive or non-interactive, is going to first call /etc/profile. As you can tell, I am having to make this final statement based on "best understanding".
    If I am misunderstanding non-interactive, can you please point me to a good link(s) that pertain to what OSX does (now that I know there is a very real difference between Linux and OSX and info for one might/will not work for the other).
    Thanks for your reply

  • View source etc. in any site

    I  want to use Dreamweaver cs6 in web development as I can use Firefox web developer:I.e. loading a page from any Site - eg www.adobe.com - and then inspect the elements on that page, looking at the source,
    pick out the css relevant to that element etc. Is that possible ?
    Thanks.

    Yes, Live view in Dreamweaver is actually a Webkit-based browser similar to Google Chrome and Safari. You can type any URL in the address bar, and inspect the HTML, CSS, and JavaScript in Split view. However, external websites are read-only. You can't edit the code.

  • Is there a xml file containing news's author, source etc

    Hi everyone, there are a few corporate news on the front page on the portal, they are html files and saved under root/documents/news/feature news or news achieve.
    When I click it the news page can be displayed in a browser window. When I move the mouse cursor on a file's name the tooltip displays the file's id like f000316a-e2ef-2810-96b4-96263a44e6e1.xml.
    Now I need a xml containing information like news author’s name, source, language, created date, modify person name etc for all the news files.
    If such data is organized in xml file where can I find out?  If such data is saved in database how I can retrieve them?
    Your early reply will be appreciated.
    Best regards.
    Wang

    Hi Wang,
    The question about retrieving this information implies the purpose, how you're going to use these date. Before anybody could help on this you'd have to clarify this more I guess.
    Anyway, I recommend to see this if you haven't check before:
    a) <a href="http://help.sap.com/saphelp_nw70/helpdata/en/f4/9d1f39a27d0e4f8a69c891dc4a4a05/frameset.htm">Properties of XML Documents</a>
    b) <a href="http://help.sap.com/saphelp_nw70/helpdata/en/1a/9a4a3b80f2ec40aa7456bc87a94259/frameset.htm">Predefined Properties</a>
    c) <a href="http://help.sap.com/saphelp_nw70/helpdata/en/67/8882410349213ce10000000a1550b0/frameset.htm">Export and Import of Properties and Metadata</a> - Maybe this is what you're looking for.
    Regards, Peter

  • Startup scripts in rc3.d not sourcing /etc/profile

    I'm trying to set some global parameters for the entire system e.g. JAVA_HOME
    I have placed these in /etc/profile
    If I login in as whoever /etc/profile is sourced.
    However when the system boots up /etc/profile is not sourced before a startup script e.g. /etc/rc3.d/S99xxxx is called
    Why is this and where can I set global parameters so that they are visible in the startup scripts and for anyone logging in etc.?

    /etc/profile (and $HOME/.profile) are not normally sourced by non-interactive shell invocations.
    Modify the script to source it explicitly if that's what you want.
    Darren

  • Missing Format Text, Insert, and Edit Source, etc Options on Some Pages

    I’m having trouble understanding why certain pages have more edit options than others. I’m new to Sharepoint Workspace 2010 and I’ve been reading/ researching for answers for 2 days now. I tried to HyperSnap in some pictures however it will not allow me
    to until my account is verified and it's not sending a verification email, sorry!
    Issue: 
    On some pages, I have the edit pencil with lots of great edit options such as Format Text, Insert and Edit Source. (This is good!)
    On some pages I have no edit pencil, but when I go to Page
    à Edit Page à I get few edit options, not including Format Text, Insert or Edit Source. (This is not good)
    After reading other somewhat similar posts, I noticed that on the pages where I get lots of edit options, they show SitePages in the URL. Where I get few edit options, SitePages is not in the URL.
    Is there a fix so that I can have the expanded edit options in all of my pages? Thank you for your help!

    Hi,
    In SharePoint we don’t have edit page options [ribbon toolbar page edit formatting options] for all types of page for application page we cannot edit application page like site pages
    again the missing edit button might be due to many causes:  
    Can you verify that it's not a permissions issue? Try navigating to the page in edit mode by appending to the url: your-site/Pages/YourPage.aspx?ControlMode=Edit&DisplayMode=Design
    Or you can try this
    your-site/Pages/YourPage.aspx? ?ToolPaneView=2
    1. You can check  that on some pages the ribbon is hidden by default. You need to make it visible by clicking on "Show Ribbon" on the "Site Actions" drop-down menu.
    2. You haven't been doing Visual Upgrade (which actually replaces your master page with the v4.master)
    3. If you have different master page and may be your master page is not 100% compatibile with SP2010, nor does it use the elements from v4.master (collaboration) or the example nightandday.master
    To add the button in your page you could use the <SharePoint:PageStateActionButton id="PageStateActionButton" runat="server" Visible="false" /> (if you've seen already that would generate the button on the left side of
    the ribbon)!
    Please can you ping the URL of the page and how you crated that page to further assist, we would be happy to help.
    Krishana Kumar http://www.mosstechnet-kk.com

  • HT1338 What about open source, etc. apps?  Integration of Software Update into App Store, Apple registration a problem?

    A review in the Seattle Times recently indicated that in Mountain Lion all apps would have to be registered with Apple.  I use lots of 3rd party apps, many open source, that are unlikely to be willing to pay Apple to register.  I've been anxious about upgrading to Mountain Lion for this reason.
    The description in the Mountain Lion promo suggests to me that my concern may be inappropriate.  It looks like they've basically migrated Software Update into the App Store.  For most of the 3rd party stuff, Software Update is irrelevant.  As long as I can manage my 3rd party apps as I have traditionally done (some I never update, others notify me of needed updates when I use them - they check themselves), I don't mind if Apple has repositioned its automated update service for more mainstream apps including its own.
    Have I got this right, or should I be concerned about support for 3rd party apps and their maintenance?

    You are right. No concern.

  • What is the impact of using a variant data type on performance, speed memory demands etc?

    This is another one of my "lets get this settled once and for all" threads.
    I have avoided variant data types whenever possible to keep the performance of my apps up. From some observatsions i have made over the years, I am of the opinion that;
    1) In-place operations can not be carried out on variants.
    2) Passing a variant to a sub-VI (regardless of the terminal on the icon connector) are always copied.
    I would like confirmation or correction of the above so we know more about this animal we call LabVIEW.
    Thank you,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    A couple notes:
    1. You can use the To/From Variant nodes for the Inplace Element Structure to operate inplace on the contained variant data. This should work just fine even if you have a big 2D array contained.
    2. Variants are incredibly useful when you use them for Variant Attributes, rather than just storing data. The Variant Attribute implementation uses a binary tree to store the key value pairs, which provides quick insertion and lookup.
    3. I don't work on the internals of LV, but I see no reason whatsoever that passing a variant into a subVI would always necessitate a copy. I could be wrong, but that sounds very odd to me.
    However, I have generally started trending towards using flattened strings. Flattened strings are generally more efficient memory-wise, because they don't contain all the type descriptor information, just the raw data. (I think there's some exception when flattening LV Classes.) Variants always store the type descriptor, so even an empty variant can take up a bit of memory.
    Variants received a big performance boost from 7.x to 8.x. They used to have a bad reputation, but I wouldn't be afraid to use them where applicable. I personally don't see a lot of benefits over flattened strings, though, except in the case of tools like the OpenG Variant INI files, which can dynamically parse out and construct variant types.
    Jarrod S.
    National Instruments

  • Loading bash-completion faster?

    getting sick of having to wait a second or so anytime i load a new shell to see my PS1.
    i found out that the sole culprit is sourcing /etc/bash_completion.
    I know you can already start typing when processing .bashrc and /etc/bash.bashrc is still ongoing, but it's kinda ugly.
    anyone knows how to make it faster?
    just some ideas that may [not] be feasible/possible:
    - load completions in the background (`source` is synchronous though)
    - show PS1 already when completions are not loaded yet.  maybe we could make it so that the end of .bashrc you change the color of PS1.
    - make a custom package of bash-completion that has no files for stuff i don't use (apt, moosay, yum etc)

    I didn't believe you in #bash. ;)
    Anyway, you can try set -a or export -f function_name (lots of functions in bash_completion so exporting them one by one isn't practical).
    Putting set -a in ~/.bash_profile will export everything. This could be a solution since that file is only sourced during login shells, meaning it'll only load it once per vc. Now instead of sourcing bash_completion from bashrc, do it from bash_profile.
    The trade-off is that now these functions/variables are available in non-interactive instances like scripts, which shouldn't be a problem since good scripts define their functions or source them at runtime.
    Edit: make sure SHELLOPTS is not exported, else the -a attribute gets inherited.
    Last edited by pwd (2009-12-28 01:41:46)

  • Basrc/bashprofile

    After looking at the vimrcs posted, I thought it might be interesting to share some bashrc/bash_profiles (whichever you put your customizations in -- my bash_profile just sources bashrc). I'm always interested in finding more efficient ways to use bash.
    shopt -s cdspell
    shopt -s extglob
    shopt -s lithist
    shopt -s no_empty_cmd_completion
    shopt -u promptvars
    alias ls='ls --color'
    alias lsa='ls --color --all'
    alias reboot='sudo /sbin/reboot'
    alias halt='sudo /sbin/halt'
    alias jedit='jedit -reuseview'
    alias cdb='cd $(cat $HOME/.currentbuffer)'
    source /etc/bash_completion
    PS1='u:W $ '
    PS1='[33[01;34m]u:[33[01;35m]W [33[01;31m]$ [33[00m]'
    PATH=$PATH:$HOME/bin
    EDITOR='vim'
    HISTIGNORE='&:fg:bg:ls:pwd:cd ..:cd*:jobs:ls -l:ls -a'
    HISTIGNORE=${HISTIGNORE}':%1:%2:popd:pushd:'
    HISTCONTROL=ignoredups
    INPUTRC=~/.inputrc
    CLASSPATH=$CLASSPATH:$HOME/bin/classpath/:$HOME/bin/classpath/activation.jar:$HOME/bin/classpath/mail.jar
    export PATH TERMCMD EDITOR HISTIGNORE HISTCONTROL INPUTRC CLASSPATH
    export DOCS=$HOME/Documents
    export ENSMER=$DOCS/code/java/ensmer
    export DUSTYWEB=$DOCS/websites/dusty2
    #:mode=shellscript:
    Also, share your bash tips and tricks... did you know that typing
    <ESC>.
    expands to the last typed argument? I just found this out.... maybe its something I should have known. ;-)  Also, somebody mentioned in another topic that ~n, where n is a digit from 0 to 9 allows you to access the last directory on the stack, something else I didn't know. (The stack is printend with dirs, added to with pushd, removed with popd, for those that don't know)
    One thing I've noticed, I often discover new efficient ways of doing things, be it in my text editor, on the commandline, or in a program (usually new abbreviations or keyboard shortcuts, for example), and I forget to use/learn them. Any suggestions for how to get around this? I'm actually tempetd to write it all down (abbreviations, shortcuts) on a sheet of paper and look at it every few minutes to try to remember stuff...
    Dusty

    Mine.
    # Source Global Configuration #
    if [ -f /etc/bashrc ]; then
        . /etc/bashrc
    fi
    # Binary PATH                 #
    PATH="$HOME/bin:/usr/local/bin:/usr/X11R6/bin:/opt/e17/bin:/opt/apps/bin:/opt/firefox:/opt/xfce43/bin:/opt/monobundle/mono/bin:$PATH"
    export PATH
    # Mozilla Folder              #
    MOZILLA_FIVE_HOME=/opt/firefox/
    export MOZILLA_FIVE_HOME
    # Aliases                     #
    alias startx='startx -- -dpi 72'
    alias ls='ls --color'
    alias mutt='mutt -y'
    alias emacs='emacs -nw'
    # Older Prompt Colors/Display #
    LIGHT_GRAY="[33[0;37m]"
    GRAY="[33[1;30m]"
    LIGHT_CYAN="[33[1;36m]"
    CYAN="[33[0;36m]"
    LIGHT_BLUE="[33[1;34m]"
    BLUE="[33[0;34m]"
    ORANGE="[33[0;33m]"
    RED="[33[0;31m]"
    GREEN="[33[0;32m]"
    LIGHT_GREEN="[33[1;32m]"
    YELLOW="[33[0;33m]"
    RESET="[33[0;0m]"
    MAGENTA="[33[35m]"
    #PS1="$RED::{$LIGHT_CYANu$GRAY@$CYANh $RED($GREENT$RED) $GRAY- $ORANGEw$RED }::n$LIGHT_GREEN.oOo. $RESET";export PS1
    PS1="$RED$(date +[%l:%M]) $BLUE[$CYANw$BLUE] $ORANGE$ $RESET"
    export PS1
    # Set Term Title              #
    case $TERM in
            xterm*|rxvt|Eterm|eterm)
                    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}07"'
            screen)
                    PROMPT_COMMAND='echo -ne "33_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}33\"'
    esac
    # Set File Colors             #
    LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
    export LS_COLORS

  • Comcast  Cable High Speed Service-No offered Firewall,Virus protection,etc

    I just switched to Comcast "High Speed" Cable internet service from Earthlink dial-up.Unfortunately the suite of security products offered are not Mac compatible. What are the most effective products out there for security for Mac's? Thanks
    IMac G5   Mac OS X (10.3.9)  

    Hi, garyah and ~Bee!
    I'm writing to echo Bee's words of encouragement.
    I also have Comcast + a Cisco router. As far as I'm concerned, the router's firewall is extra gravy — OS X's is fine. Enabling this firewall "built-in" to OS X 10.3.9 that ~Bee mentioned is a simple matter: System Preferences »» Sharing »» Firewall »» Start. Mac Help »» type in "firewall" and »» "sharing" will provide you with ~all you want to know. [1]
    Beyond this, imo, common-sense resistance to "social engineering" is the best protection — i.e., think before opening an email attachment or launching an .exe file from a potentially dubious source, etc...
    Security remains one of the subtle pleasures of Mac ownership. [fingers crossed!]
    Warm regards,
    Dean
    [1]   Various "Services" may need to have ports "On" in Sharing — but each port opened to enable network services is unprotected, even with the firewall running. This is good to keep in mind, too.
    Hey, ~Bee — what'd'ya mean none of Comcast's perq's are Mac-compatible? Don't Comcast Mail and "The Fan" work for you? </giggle>   While this context is handy, have you ever used their "Personal Web Page service?" My son's bugging me to put up a web page, and I'm a true neophyte...

Maybe you are looking for