Results 1 to 3 of 3

Thread: cd into the $DISPLAY directory

  1. #1
    Join Date
    Jun 2008
    Location
    NYC
    Beans
    36
    Distro
    Ubuntu Studio 11.04 Natty Narwhal

    cd into the $DISPLAY directory

    Hey everybody

    i was wondering if we could cd in the directory of the PATH variable

    for example, if i type in echo $DISPLAY

    it will give me /tmp/launch-3ee4fg/org.x:0

    is there any way that i can just take the value '/tmp/launch-3ee4fg/' from the output of $DISPLAY and exclude out the filename to the end of the command

    i tried using the read command and the IFS variable..apparently IFS does not recognise / i guess

    but any help is greatly appreciated...
    Thinkpad X61
    Thinkpad R500
    Not getting any younger thinkpads:
    Thinkpad R40 - RIP

  2. #2
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: cd into the $DISPLAY directory

    How about this?
    Code:
    dirname $DISPLAY

  3. #3
    Join Date
    Jun 2008
    Location
    NYC
    Beans
    36
    Distro
    Ubuntu Studio 11.04 Natty Narwhal

    Re: cd into the $DISPLAY directory

    GOT IT!!
    You are awesome..thank you sir..
    Thinkpad X61
    Thinkpad R500
    Not getting any younger thinkpads:
    Thinkpad R40 - RIP

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •