Welcome to the Linux Foundation Forum!

Errata on Lab 3.3. Command Alias > Solution

Options

The solution claims that no quotes are needed for:
The alias line would look like this:
$ alias projx='cd /home/staff/RandD/projects/projectX/src'

Note you can use double quotes instead of single quotes, or use no quotes at all since their is no white space in your defined alias.

which throws an error if you try it.

[karapja@localhost /]$ alias cddirs='cd /tmp/dir1/dir2/dir3'
[karapja@localhost /]$ cddirs
[karapja@localhost dir3]$

[karapja@localhost /]$ alias cddirs=cd /tmp/dir1/dir2/dir3
-bash: alias: /tmp/dir1/dir2/dir3: not found

Comments

  • luisviveropena
    Options

    Hi @ikarapatakis,

    Yes, that command won't work without quotes, because it has a space in it. If there isn't any space, it will work without quotes.

    Thanks for informing us!

    Luis.

  • ikarapatakis
    Options

    I believe I have found a few more typos, that could be corrected.
    Is it helpful?
    Would you like me to post them here under the same title or under a new title for the lesson they are in?
    Is there an email I could send them to, in order not to spam the forum?

  • fcioanca
    fcioanca Posts: 1,919
    Options

    @ikarapatakis Please post them here.

  • giampaolo.eusebi
    Options

    03 User Environment
    Command aliases

    the line $ alias rm='rm -i" has mixed single and double quotes.

  • luisviveropena
    luisviveropena Posts: 1,159
    Options

    Hi @giampaolo.eusebi, ok, thanks for reporting it!

    Regards,
    Luis.

Categories

Upcoming Training