Find the answer to your Linux question:
Results 1 to 3 of 3
1)what is the diff between echo and cat. cat displays the output of a file on the screen. dont echo does about the same? 2)Can anyone explain this command to ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    29

    Command question

    1)what is the diff between echo and cat.
    cat displays the output of a file on the screen. dont echo does about the same?

    2)Can anyone explain this command to be?
    sh -c " echo 'export XMODIFIERS=@im=SCIM ; export GTK_IM_MODULE="scim" ; export QT_IM_MODULE="scim" ; scim -d " > /etc/X11/Xsession.d/95xinput"


    I need it to install chinese

    tia

  2. #2
    Just Joined! Dave68's Avatar
    Join Date
    Jul 2010
    Location
    Bolivar, MO
    Posts
    19
    Question 1)

    Try this in terminal:

    "apropos" knows all commands and what they do. You just have to ask.

    apropos echo

    apropos cat.

    Hope That Helps,
    Dave

  3. #3
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    Regarding 1], there are also the manual pages "man echo / man cat"

    Regarding 2]
    sh -c executes the command string followed; "man sh" tells me this:

    Code:
    -c string If  the  -c  option  is  present, then commands are read from
    		 string.  If there are arguments after the  string,  they  are
    		 assigned to the positional parameters, starting with $0.
    So this is the code to be executed:
    Code:
    echo 'export XMODIFIERS=@im=SCIM ;
    export GTK_IM_MODULE="scim" ;
    export QT_IM_MODULE="scim" ;
    scim -d " > /etc/X11/Xsession.d/95xinput
    Disassembling this yields that you want to write this:
    Code:
    export XMODIFIERS=@im=SCIM ;
    export GTK_IM_MODULE="scim" ;
    export QT_IM_MODULE="scim" ;
    scim -d
    to the file /etc/X11/Xsession.d/95xinput

    unfortunatly you have a syntax error (quotes are wrong), thus the script should not work at all.

    I hope this explanation helps you solving such things by yourself in the future.

Posting Permissions

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