Aliases and .. in bash

I asked about this a while back http://bbs.archlinux.org/viewtopic.php?id=79301, but we didn't get it figured out.
Try this:
$ mkdir -p $HOME/test/{alpha,beta}
$ cd $HOME/test/alpha
$ touch one
$ ln -s $HOME/test/beta alphabeta
$ cd alphabeta
$ pwd
/home/jim/test/alpha/alphabeta
$ pwd -P
/home/jim/test/beta
$ ls ../o<here press tab>
If you have bash-completion activated, then pressing tab will correctly autocomplete to give you:
$ ls ../one
So for autocompletion .. pays attention to your logical working directory, whose (logical) parent is ~/test/alpha.
However look at the output of the ls command:
ls: cannot access ../one: No such file or directory
Huh? It looks like the ls command itself is interpreting .. to refer to the directory's physical parent instead. Who would want to do that?
If that's what I wanted, I would "cd -P ." first.
This behavior has been plaguing me for all of Bash 4.x. I haven't gone back to Bash 3.x but I really don't think it was always this way. (I wouldn't be so surprised everytime it happens if I've been dealing with it for years.)
In my previous post, others reported not seeing this same behavior. So I thought it might be something in my .bashrc. But even if I move all my bash-related dotfiles elsewhere and start a new shell, I still get this problem. Can others at least report in whether they see this behavior too?
I just now tried building and installing the new bash 4.1 (and readline 6.1) that were just released, but I get the problem with them too.

I get the same result on BASH 4.0.35:
[mike@mac|~/test] $ ls -ia {alpha,alpha/alphabeta,beta}
alpha:
658340 . 658333 .. 658343 alphabeta 658342 one
alpha/alphabeta:
658341 . 658333 ..
beta:
658341 . 658333 ..
That is alpha, alpha/alphabeta and beta all have the same parent according to ls. Can't say this has ever been an issue for me though.

Similar Messages

  • [solved] run dmenu with custom aliases and functions

    Is it possible to run my custom bash aliases and functions with dmenu?
    My aliases are placed in ~/.bash_aliases and my functions are in ~/.bash_functions.
    I source them in my ~/.bashrc through:
    Functions
    if [ -f ~/.bash_functions ]; then
    . ~/.bash_functions
    fi
    # Aliases
    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi
    Last edited by orschiro (2013-12-27 08:41:40)

    No problem!... sorry, I was about to post an "improved" version, but it breaks support for functions, doh!
    EDIT: finally got it to work as I wanted Sorry, zsh stuff is gone from mine, I don't use it -- feel free to borrow the improvements for your version though!
    v1.4 Changes:
    - removed unnecessary if statements
    - removed unnecessary 'source' command
    - added some logic to see if the command is a real program, or an alias/function - this saves spawning bash shells that aren't needed
    v1.5 TODO list:
    - add some "history" feature so that commonly used commands appear first in the list
    #!/bin/bash
    cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
    if [ -d "$cachedir" ]; then
    cache=$cachedir/dmenu_run
    else
    cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
    fi
    cmd=`(
    IFS=:
    if [ -f ~/.bash_aliases ]; then
    aliases=( ~/.bash_aliases )
    fi
    if [ ~/.bash_functions ]; then
    functions=( ~/.bash_functions )
    fi
    if stest -dqr -n "$cache" $PATH || stest -fqr -n "$cache" "$aliases" || stest -fqr -n "$cache" "$functions"; then
    stest -flx $PATH
    source $aliases
    alias | awk -F '[ =]' '{print $2}'
    compgen -A function
    ) | sort -u | tee "$cache" | dmenu "$@"
    else
    dmenu "$@" < "$cache"
    fi
    )`
    if [ -f ~/.bash_aliases ]; then
    if [ ! -z $(which $cmd) ]; then
    exec $cmd &
    else
    echo -e "source ~/.bash_aliases \n $cmd" | bash -O expand_aliases &
    fi
    fi
    Last edited by dennis123123 (2014-04-21 10:09:39)

  • I created a CD for a friend (with photos).  She got a blank CD with a message that it had only aliases and couldn't (of course) locate the originals.  What did I do wrong.  I've never had a problem preparing and burning CDs before.

    I created a CD for a friend (photos).  She received a blank CD with a message, something about aliases and no originals.   When I tried again, and dragged files to the CD they appeared only as aliases.  Of course they wouldn't open on another computer.  I've never had a problem preparing CDs before and haven't a clue what went wrong???  Thank you!!

    If you drag files to the CD they appear as aliases until you burn the CD. Verify the files as images after you burn the CD

  • When will Smartview support display both aliases and members?

    In the Essbase classic add-in, users had the ability to display both aliases and member names. When using Smartview with Essbase, this isn't supported. Are there plans to add this back? Thanks.

    I heard this is the most requested parity feature of the addin, that Oracle may be doing this sometime in 2010 since it is a complicated fix.

  • WebVPN Tunnel-Group Aliases and URLS

    Hi,
    <br />
    <br />I have a requirement to create a new group policy and a new tunnel-group and apply it to a webvpn user account
    <br />
    <br />
    <br />The web vpn is working fine without any issues when I give a new name under Group Aliases and URL
    <br />
    <br />My requirement is to use the existing Group Alias for this new tunnel-group. When I enter the existing alias it says it is already used by other tunnel-group
    <br />
    <br />Please help

    If you use the same group-alias for two tunnel-groups, then how will the firewall distinguish between the two? Let say, as per your requirement you want to have the group-alias 'securevpn' for two tunnel-groups, TG1 and TG2. Now how will the firewall map a user landing on this alias to a group? TG1 or TG2? round-robin? :). This is not possible AFAIK.
    Please rate if helpful.
    Regards
    Farrukh Haroon
    CCIE # 20184 (Security)

  • Desktop aliases and open folders refresh every 60 seconds or so

    Since this morning's boot, all my desktop aliases and open folders refresh every 60 seconds or so
    How to stop this very irritating phenomenon, please?

    Wooah, yeah I think that's done it. Also seems to have fixed it for my friend using CS6. Thanks for the help. I guess I was right with my every 10 minutes estimate then, it was exactly 10 minutes
    Surprised it locks it up so bad though. Maybe there should be a warning message if it regularly takes longer than a few seconds telling you what it was and how to disable it.
    Thanks,
                Mike.

  • I made the fatal mistake of allowing iCloud to handle my @mac mail account. I had set this address up with aliases and never had a problem.  Ever since iCloud has been handling it I have had problems. It seams impossible to claim my account back from iClo

    I made the fatal mistake of allowing iCloud to handle my @mac mail account.
    I had set this address up with aliases and never had a problem.
    Ever since iCloud has been handling it I have had problems.
    It seams impossible to claim my account back from iCloud. How can it be achieved or has Apple set a booby trap?

    iCloud is the successor to MobileMe. MobileMe shuts down forever tomoorrow.
    If you only want to use the email portion of your previous MobileMe account you can. You do not have to use all the other features of iCloud, just like you didn't have to use all the other features of MobileMe.
    The email account has not really changed at all. Just the server address it comes from.
    The sending emails problem you are having, is this on your Mac in Mail, in webmail at iCloud.com or on your iOS device?
    When it doesn't succeed in sending, what does it do? Any error message?
    What mail server settings are you using in Mail? What version of Mac OS X are you using?

  • Aliases and Sieve

    Hello,
    I'm currently trying to decide if I should use OS X Server style aliases or postfix style aliases (or both).
    The MailServicesAdmin-Guide states that:
    "The downside is that Mail service’s Sieve functionality doesn’t understand Mac OS X Server-style aliases and will not filter mail based on the Mac OS X Server-style alias."
    and
    "Only aliases generated by the Postfix-style method can be acted upon by Sieve scripts."
    However, I find these statements quite confusing. For me, Sieve = vacation notices & e-mail rules. E-mail rules work fine with both alias-styles, but vacation notices don't - the WebService used to configure them obviously enumerates all OS X Server style aliases for a given username and ONLY acts on them (which could come in handy - you could set up an postfix-style alias used for mailing-lists / newsletters where you don't want to send vacation notices, and use OS X Server style aliases where you do want to send them).
    So what does Apple mean when they say that Sieve can't act upon OS X Server style aliases?
    Regards,
    Rainer

    Hey!

  • Added an aliases and it deleted all the others? bad news for me :(

    I just added an aliases in mail, all I did was click add aliases and added a new one, clicked create and all of my other aliases disappeared? this is not very cool, I've never had anything this bad happen on my Mac ever. please tell me its going to be Ok! pleasssse
    Scott

    I assume you’re talking about .Mac aliases, right? Unless someone else has a better idea, I suggest you to report the problem to .Mac email support.

  • Type Aliases and Project Coin.

    Back in the early days of this forum there was quite a lot of discussion about aliasing generic types.
    [Generics - Time for an "alias" keyword?|http://forums.sun.com/thread.jspa?forumID=316&threadID=589163]
    With project coin underway to define a set of small changes for the java language, now would be a good time to revisit the generic alias issue.
    Is anyone currently working on a type alias proposal for project coin?
    Is anyone intending to?
    Is anyone interested in working on a type alias proposal?
    Bruce

    there is an existing proposal on the coin mailing for [Import Aliases for Classes and Static Methods|http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000069.html]
    that could be a starting point - just drop the method aliasing and change it from Class aliasing to type aliasing, and probably use the '=' syntax rather than 'as' keyword (as suggested in [RFE 4478140|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4478140])
    30 March is miles away to do this. I am hoping to make 4 or 5 proposals myself, and only one has been started to any degree.
    Bruce

  • LC_NUMERIC and LC_TIME bash warning when logging into TTY

    I recently re-installed Arch after bouncing around a few distributions, and ever since I completed the install, I've had the following error when logging in to the TTY (only there, never noticed it anywhere else).  Specifically, the error reads:
    -bash: warning: setlocale: LC_NUMERIC: cannot change locale ()
    -bash: warning: setlocale: LC_NUMERIC: cannot change locale ()
    -bash: warning: setlocale: LC_TIME: cannot change locale ()
    -bash: warning: setlocale: LC_TIME: cannot change locale ()
    Output of locale:
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    locale -a
    C
    en_US.utf8
    POSIX
    en_US.UTF-8 is also uncommented in locale.gen, and it's been generated.  I haven't gotten any locale errors in any application I use, and it only appears before the prompt after logging in to a TTY screen.  I've also not set those variables to anything else in /etc/profile, /etc/bash.bashrc, .profile/.bashrc.  Logging into the root user instead of my user account does not result in the errors.  Also, it seems from the error that the locales are being set to "", and I can't for the life of me figure out where it's coming from.  I've searched the forums for similar problems, and most of these errors included warnings about files and folders not existing, which doesn't happen here, and were resolved by re-generating the locale (I've tried it, no change).  The only one that came close was an old forum thread about guarddog generating a different set of locale's using incorrect locale definitions, which resulted in the same errors.  If anyone has a suggestion as to how to fix this (or a handy trick for finding all files where locales are set), I'm open to them.
    .bashrc:
    # .bashrc (2013, Dec 11)
    [ -z "$PS1" ] && return
    # set a fancy prompt (non-color, unless we know we "want" color)
    case "$TERM" in
    xterm-color) color_prompt=yes;;
    esac
    if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
    fi
    if [ "$color_prompt" = yes ]; then
    PS1="\[\e[0;37m\]⮀\[\e[0;32m\]\u\[\e[0;36m\]@\[\e[0;32m\]\h\[\e[0;37m\]:\[\e[0;33m\] \W\[\e[0;37m\]\[\e[0;37m\]\$\[\e[0m\] "
    else
    PS1="\[\e[43m\]\[\e[31m\]\u\[\e[0;33m\]\[\e[46m\]⮀\[\e[34m\]\h\[\e[0;36m\]\[\e[47m\]⮀\[\e[33m\]\W\[\e[0;37m\]⮀\[\e[0m\] "
    fi
    unset color_prompt force_color_prompt
    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.
    #if [ -f ~/.bash_aliases ]; then
    # . ~/.bash_aliases
    #fi
    # enable color support of ls and also add handy aliases
    if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='ls --color=auto --format=vertical'
    #alias vdir='ls --color=auto --format=long'
    #alias grep='grep --color=auto'
    #alias fgrep='fgrep --color=auto'
    #alias egrep='egrep --color=auto'
    fi
    ##custom aliases
    alias ls="ls -la --color=always --classify"
    alias lh='\ls -a --classify | grep "\."'
    alias halt="sudo shutdown -P now"
    PATH=$PATH:$HOME/.rvm/bin:$HOME/.gem/ruby/2.0.0/bin # Add RVM to PATH for scripting
    .profile:
    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.
    # the default umask is set in /etc/profile
    #umask 022
    # if running bash
    if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
    fi
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    fi
    PATH="$PATH:/usr/local/sbin"
    PATH="$PATH:/usr/local/bin"

    An update:
    I've tried explicitly exporting both variables with en_US.UTF-8 in my bashrc, which has resulted in no change whatsoever.  Checking the value of these variables from my running system yields an empty return (i.e. the variables aren't set).  Can someone let me know if these variables are set on their system?  If they are, I'll see if I can set them manually and if that resolves the issue.

  • Preview - anti aliasing and text in scanned pdf

    hello all,
    i have an issue with preview not anti aliasing text in pdf files.  to elaborate, take a pdf with text which is selectable and it appears jagged, not anti aliased as in pdfs with text which is treated as an image, i.e. not selectable.
    also, sometimes, when scrolling through pages in full screen, the following page has the text anti-aliased as the scroll animation is taking place, i.e. while the previous page is being moved away through the gesture, but once the previous page has disappeared and the new page 'settled in' the smoothing is gone.
    smooth text and line art is checked, as is lcd smoothing in general preferences.
    any suggestion are much appreciated.
    s.

    Hi 1ndivisible,
    Hmm, that's odd. My type is looking pretty decent out of Illustrator. Can you try a different font or the same font in a new sequence?
    Thanks,
    Kevin

  • Aliases and Sending Mail

    I'm running iMS 5.1. I'm wanting to be able to allow webmail users to specify an alias address without the domain for sending mail. I.E... user zzUser is aliased to some.user. In the webmail client I want someone to be able to type in just "zzUser" instead of "[email protected]". Is this possible?
    Thanks,
    Patrick Danko

    Not completely sure I understand what your asking, but if you Enabled virtual hosts in server admin>Mail>Advanced>Hosting and entered domain1.com, domain2.com, etc., The only thing you have to do is enter the short name in the Workgroup Manager like johndomain1com, and enter an alias underneath [email protected], and so on for the rest.The mail server resolves the alias from there on.
    We usually, to keep things organized by domain in WGM, enter the short name like domain1-com-john, and add an alias of [email protected], then domain2-com-john, and alias [email protected]

  • Table aliases and Code Insight Completion

    Oops, never mind, I see there are lots of threads on this... so the big question is: Does anyone know when this will be supported?
    One thing I am noticing with the new SQL Developer is that if you use table aliases (as we do here) that Code Insight Completion doesn't work. For example, if I type the following SQL:
    SELECT *
    FROM My_Table mt
    WHERE mt.
    At the point where I put the dot (i.e. mt.) I would assume that code insight would drop down a box showing me the columns in the alias mt (i.e. My_Table). But nothing happens. Now if I put the full table name My_Table in there (i.e. WHERE My_Table.) then the drop down occurs. But not if you use a table alias - and putting the full table name in defeats the purpose of using aliases.
    I know that in other SQL developers (such as PL/SQL Developer) this works fine and we are used to it working this way with aliases. Is there another way to get SQL Developer to do it this way? Or is this going to have to be a NEW feature later on?
    Thanks.
    Tom
    Message was edited by:
    tbsimpson

    Try searching this has been answered.
    http://forums.oracle.com/forums/search.jspa?objID=f260&q=alias+insight
    -kris

  • Aliases and cd-r downloads

    I have an e-Mac and lost (trashed and deleted) a small, self assembled, working reference library that was part of a much larger project that I have been working on for over three years.
    I didn't worry too much because monthly (if not weekly) I had religiously saved my work to the cd-r BUT, when I went to re-install that one section (#4) the e-mac wouldn't accept it and gave me some rigamarole that I could not get by concerning an alias for that text not being present or accessible.
    For a while I had the awful feeling that testing whether or not I was actually saving to the cd was just the computer telling me that 'Yup. We have document by that name and here it is.' so I copied 'Mary had a little lamb.' from AppleWorks onto a cd in PC XP format and it did carry over to the PC so the cd actually has the memory of 5 documents but I cannot access #4.
    Although they are held and saved as separate documents there is no 'official' comparmentalization of this collection of texts.
    I tried to get rid of all the aliases with that document's designation to give the e-Mac a clear field but it still balked at just this one document of the five.
    Any help would be appreciated because if the same thing happens to the main text (folks get tired and stuff happens) there goes three years's work and something like two and a half million + keystrokes down the drain.

    Hi again,
    Let's ignore the chaff and cut to the chase;
    +[T]he count of data from the drop down 'get info' menu from a year ago was 2.4 MB and the count of data on the latest saved to cd in September 2007 was 3.0 MB so something is getting saved to the cd besides just the aliases but why can't I get that one document (#4 0f 5)to reload off the cd?+
    The space used numbers do indicate there's actual data on both CDs, and that there's more on the newer one than on the older one.
    Have you done a Get Info on the individual files? Check #4 and at least two of the others in the same set. Do the same check with the originals of the same files on your hard drive. You'll get two numbers for the Size of each file, for example: 12 KB on disk (5961 bytes).
    The first number is the amount of space alloted to the file on the disk, in this case 12 KB. This number could be different (probably smaller) for the same file saved on a CD, where space is alloted in smaller chunks. The second number is the actual size of the file.
    If the files have not been changed since being burned to disk, the first Size numbers should be similar for both copies of the file, the second numbers should be identical for both copies.
    If all five files in the set are similar (eg. all word processor files and all with about the same page count) their sizes should also be similar.
    +(As far as the numeral added test I inserted the numerals into the document and then saved the document to a cd and then recalled the document from memory and erased the numerals and then reloaded the document via the cd memory and the numerals appeared. In retrospect, if the cd was only looking for an alias to uncover or point to it would not have recovered the numerals as it did because those numerals had been deleted from the document.)+
    More precise details (and language) would help get an accurate picture of what you did, and the possible resulting actions by the computer. What you've said here still leaves open the possibility of an alias on the CD opening a file that included the numbers.
    The Mac cannot "Save" a document directly from an application to a CD.
    Do you mean you added the numerals to the document, then Saved the document to your hard drive, closed the document, then burned the file to a CD?
    "[R]ecalled the document from memory" could mean anything from 'retyped a memorized version of the document' to 'went back to AppleWorks and brought the still open document to the front' to 'opened the copy of the file containing the added numbers in my * folder'.
    Do you mean you opened the copy of the document that had been saved (with the numerals added) on my hard drive, deleted the numerals from the document, Saved the document in the same location, using the same name, then closed the document.
    If you did all these things, then yes, the document that an alias would point to would be one which did not include the numbers, and a document with the numbers included would have to have come from the CD.
    If you missed or changed any of these steps, the document to which an alias on the CD would point would likely be a copy still containing the numbers, as that copy would not have been overwritten when or if you saved the document after deleting the numerals.
    Going back to +why can't I get that one document (#4 0f 5)to reload off the cd?+
    If the size checks above indicate that file #4 on the CD is the same as #4 on the hard drive (which may be impossible to determine, as a quick glance at the portions of your posts listed in your profile indicate the files have been deleted from your hard drive), or indicate it is similar in size to the other four files in the set, then I'd suspect a corrupted file.
    What happens when you try to open File #5 (not the bad one, one of the ones that will open) by double clicking its icon in the CD window?
    Note: Start with NO applications running except the Finder, insert the CD, open it (if it's not set to automatically open, then double click the file's icon. Describe what happens from then until you see the file, including any messages that require a response from you and your response to them.
    What happens when you try to open File #4 (the bad one), starting from the same conditions as above?
    Again, describe each event from the time you double click the file's icon until the time you see the document (or until it's clear that you are nont going to see the document). Pay particular attention to the exact montent of dialogues, alerts, warnings or messages appear on the screen, especially those requiring a response from you.
    Those two descriptions may shed some light on what's going on.
    Regards,
    Barry

Maybe you are looking for

  • Sales Report Generation less the Credit memo

    Anybody can help me regarding Query for Sales Report. Im trying to create a sales report per Per Product and Customer with corresponding Quantity and Amount, I have already get the query the problem is I cant get the Credit Memo deduct from its A./P

  • USB slot of Satellite L30 shuts down Windows when in use

    I recently bought a Satellite L30 (psl33E) for my wife, and all seemed to go well. That was until she needed more usb ports for her stuff, and used the port on the left hand side of the machine (as opposed to the one always used, at the back.) As soo

  • Error Message  when trying to "Save Email as Activity" on Outlook 2007

    Hi all, This is a problem that we have logged with SAP, but they cannot find any reasons as to why we are having the problem. So I'm hoping someone here might be able to shed some light... After logging onto SAP through Outlook: When "Saving an email

  • Is this possible in AS3?????  AS3 commercial application with speech, avatar real-time animation and innovative GUI

    Hi, Check out this awesome AS3 application from Umanify: http://www.icex.es/icex/cda/views_icexv3/asistenteVoz/asistenteVoz/0,6457,,00.html You can drag&drop the GUI of the assistant on the web page with the mouse...they are using transparent layers.

  • Making the fixed Length.

    hai folks,           I have a problem with the current object in my Project. that is i am uploading the data to application server . i need to upload with fixed defined length . Example as we know  kunnr(length 10) , name1 (lenght15), currency (lengh