Announcement

Collapse
No announcement yet.

Konsole is a little ignorant

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Konsole is a little ignorant

    Hi, I opened Konsole and said hello. It replied
    Command 'hello' not found
    which I thought quite rude.

    So I typed alias hello='echo "Hello Darren, what would you like to do today?"' so now I type hello and it says
    Hello Darren, what would you like to do today?: command not found
    How do I get rid of the command not found part please?

    Oh, and do I put that in .bashrc to make it permanent?

    Thanks
    Last edited by darren7659; Sep 26, 2024, 07:32 AM.

    #2
    Worked like a charm here:

    Code:
    stuart@office:~$
    stuart@office:~$ hello
    Hello Darren, what would you like to do today?
    stuart@office:~$​
    Odd thing is my name is not Darren.

    Maybe you've done something in .bashrc or .profile (like in your prompt) that's giving you the command not found message?

    You would put it in alias in ~/.bash_aliases.

    Please Read Me

    Comment


      #3
      Originally posted by oshunluvr View Post
      You would put an alias in ~/.bash_aliases.
      Writing the alias exactly as the OP (but changed Darren to Paul), and updating the alias file (source ~/.bash_aliases), then typing hello produces Hello Paul, what would you like to do today? Yeah, works correctly.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


      • oshunluvr
        oshunluvr commented
        Editing a comment
        but Paul isn't my name either...

      #4
      Cheers to the two of you. I put it in .bashrc and it works correctly. It was only when I fed it into Konsole directly and tested it I got the command not found part

      Comment


        #5
        Originally posted by darren7659 View Post
        Cheers to the two of you. I put it in .bashrc and it works correctly. It was only when I fed it into Konsole directly and tested it I got the command not found part
        Honestly, .bashrc isn't the best place for aliases - that's what .bash_aliases if for. The reason is, it's possible that some update or another down the road could replace .bashrc thus deleting your edit. .bash_aliases is never updated by an outside process and intended to persist as you have made it.

        Just food for thought...

        Please Read Me

        Comment

        Working...
        X