Results 1 to 2 of 2

Thread: 'echo $XDG_DOCUMENTS_DIR' returns empty line

  1. #1
    Join Date
    Jun 2009
    Beans
    29
    Distro
    Ubuntu 14.04 Trusty Tahr

    'echo $XDG_DOCUMENTS_DIR' returns empty line

    Hello,
    though in ~/.local/user-dirs.dirs there is the line:
    Code:
    XDG_DOCUMENTS_DIR="/media/dati/Documenti"
    when I open a terminal and enter
    Code:
    echo $XDG_DOCUMENTS_DIR
    the command returns an empty line

    why is that? why does the terminal not return the value "/media/dati/Documenti"?
    does that imply that every other program sees an empty line too when given the $XDG_DOCUMENTS_DIR parameter?


    by the way if I enter
    Code:
    echo $XDG_DOCUMENTS_DIR/games
    the command returns only
    Code:
    /games
    with no leading spaces before it
    Last edited by kebabbaro; February 5th, 2015 at 11:53 AM.
    Tinkering with Ubuntu 14.04 and Puppy Linux currently

  2. #2
    Join Date
    Aug 2014
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: 'echo $XDG_DOCUMENTS_DIR' returns empty line

    What makes you think the entries in user-dirs.dirs will show as variables in the terminal?
    Code:
    echo $XDG_DOCUMENTS_DIR
    returns an empty line because $XDG_DOCUMENTS_DIR returns nothing but echo still outputs the trailing newline.
    Get the same result if you just run "echo" by itself.

    From man echo...
    Echo the STRING(s) to standard output.

    -n
    do not output the trailing newline
    enter "echo $XDG" in terminal and press tab a few times to show available auto-completion...
    Code:
    glen@Trusty:~$ echo $XDG_
    $XDG_CONFIG_DIRS       $XDG_GREETER_DATA_DIR  $XDG_SEAT              $XDG_SESSION_PATH
    $XDG_CURRENT_DESKTOP   $XDG_MENU_PREFIX       $XDG_SEAT_PATH         $XDG_VTNR
    $XDG_DATA_DIRS         $XDG_RUNTIME_DIR       $XDG_SESSION_ID
    Last edited by CantankRus; February 5th, 2015 at 04:06 PM.

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
  •