Linux.com

tanlocnguyen102

tanlocnguyen102

  • Linux.com Member
  • Posts: 1
  • Member Since: 29 Nov 12
  • Last Logged In: 30 Nov 12

Latest Posts

Posted by
Topic
Post Preview
Posted
  • tanlocnguyen102
    script!!!
    hi guys! i'm newbie and i've got a porblem here... i want to use a function instead of a command, such as using "a" to replace for "who" command ( except using "alias" ).. so i have this script . ./a.sh [root@ftp ~]# cat a.sh #!/bin/bash function a { unset a echo " $a=$(who) " } But the result is a =root :0 2012-11-28 08:36 root pts/1 2012-11-28 08:36 0.0) i wanna remove "=" in result, pliz tell me how to do that... thanks for helping me
    Link to this post 29 Nov 12

    hi guys!
    i'm newbie and i've got a porblem here... i want to use a function instead of a command, such as using "a" to replace for "who" command ( except using "alias" ).. so i have this script

    . ./a.sh
    [root@ftp ~]# cat a.sh
    #!/bin/bash
    function a {
    unset a
    echo " $a=$(who) "
    }

    But the result is

    a
    =root :0 2012-11-28 08:36
    root pts/1 2012-11-28 08:36 0.0)

    i wanna remove "=" in result, pliz tell me how to do that... thanks for helping me

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board