Results 1 to 5 of 5

Thread: Enviroment setting

  1. #1
    Join Date
    2016-Aug
    Posts
    13

    Enviroment setting

    I am trying to capture the Desktop ID from xwininfo using:
    User@name:~$ DESKTOPID="$ xwininfo -int -name Desktop | head -2 | awk '{print $4}'"
    User@name:~$

    I then try to see that DESKTOPID has something in it and get:
    User@name:~$ printenv DESKTOPID
    User@name:~$

    I also tried this:
    User@name:~$ echo $DESKTOPID

    User@name:~$

    Please help, what am I doing wrong? Thank you in advance.

    Operating System:
    Linux version 4.3.0-kali1-amd64 (gcc version 5.3.1 20160101 (Debian 5.3.1-5) ) #1 SMP Debian 4.3.3-5kali4 (2016-01-13)

  2. #2
    Join Date
    2016-Aug
    Posts
    13
    Quote Originally Posted by Personal View Post
    I am trying to capture the Desktop ID from xwininfo using:
    User@name:~$ DESKTOPID="$ xwininfo -int -name Desktop | head -2 | awk '{print $4}'"
    User@name:~$

    I then try to see that DESKTOPID has something in it and get:
    User@name:~$ printenv DESKTOPID
    User@name:~$

    I also tried this:
    User@name:~$ echo $DESKTOPID

    User@name:~$

    Please help, what am I doing wrong? Thank you in advance.

    Operating System:
    Linux version 4.3.0-kali1-amd64 (gcc version 5.3.1 20160101 (Debian 5.3.1-5) ) #1 SMP Debian 4.3.3-5kali4 (2016-01-13)
    Turns out it I should have used (parentheses) instead of "quotes" in line 2.

  3. #3
    Join Date
    2016-Jul
    Posts
    40
    According to bash syntax, it's: DESKTOPID=$(xwininfo -int -name Desktop | head -2 | awk '{print $4}')

  4. #4
    Join Date
    2016-Aug
    Posts
    13
    Yes, I forgot I changed that also. Thank you for pointing that out.

  5. #5
    Join Date
    2013-Sep
    Posts
    264
    For the record you could put your piped commands between `` (in this case) instead of $()
    Code:
    DESKTOPID=`xwininfo -int -name Desktop | head -2 | awk '{print $4}'`
    Last edited by kcdtv; 2016-08-05 at 15:52.

Similar Threads

  1. Setting up RPi 3 B
    By Sunstarx55 in forum ARM Archive
    Replies: 1
    Last Post: 2017-05-09, 10:16
  2. Can't start VNCServer - User enviroment not set
    By xxxxxx in forum NetHunter General Questions
    Replies: 0
    Last Post: 2015-09-25, 02:23

Posting Permissions

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