Find the answer to your Linux question:
Results 1 to 5 of 5
I want to create a simple dialog based application where at startup it will print the welcome screen along with username.. I am trying to call it like that but ...
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3

    dialog based control

    I want to create a simple dialog based application where at startup it will print the welcome screen along with username.. I am trying to call it like that but instead of username whoami appear in dialog. Code below


    n=whoami
    dialog --title "Welcome to the System Administration Utitlity $n" --msgbox "" 4 100

  2. #2
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Hi,
    when you set a variable with a command output, you must use `command`:
    n=`whoami`

    Regards
    There are people trying to avoid mistakes and another that tries to target.

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3
    Quote Originally Posted by JosePF View Post
    Hi,
    when you set a variable with a command output, you must use `command`:
    n=`whoami`

    Regards


    But in the output its not showing the username... it will show the value of n 'whoami'..

    Any solution?

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,099
    not '
    use `
    You must always face the curtain with a bow.

  5. #5
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Or you can use a buildin variable
    Code:
    n="$USER"
    Can't tell an OS by it's GUI

Posting Permissions

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