Your Turn

In this chapter, you explored a few ways to customize your environment. Take a shot at these challenges to stretch your thinking before moving on.

  1. For each of the following variables, identify what the variable is for and whether it’s an environment variable or a shell variable:

    • HOME
    • LANG
    • OLDPWD
    • CDPATH
  2. Create the following aliases:

    • An alias called ep which opens your ~/.bashrc file in nano so you can make changes quickly.

    • An alias called sp which sources your ~/.bashrc file so you can apply those changes.

    • An alias that displays the shell and environment variables, without displaying functions, that displays the results one page at a time.

  3. Modify your showme function to display a calendar. Use the cal or ncal command you explored in the exercises in Chapter 1, Getting Your Feet Wet.

  4. You can use the source command inside of your .bashrc file to load other files. This lets you create a more organized and modular configuration. Try this out:

    1. Create a new file called ~/.aliases and move your alias definitions to that file.

    2. Modify the ~/.bashrc file to load the ~/.aliases file using source ~/.aliases.

    3. For extra safety, research how to only include the file if it exists.

  5. Add these keybindings in your ~/inputrc file:

    1. Create a binding that wraps a line with opening and closing parentheses.

    2. Create a binding similar to the binding that wraps the line with quotes, but instead of adding a quote to the beginning of the line, add it after the first word. This way, you can convert echo hello world to echo "hello world" with a keystroke. Hint: ef jumps forward one word and eb jumps back one word.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.38.99