Chapter 2 answers

From Linux Shell Scripting Tutorial - A Beginner's handbook
Revision as of 22:50, 29 March 2016 by Admin (talk | contribs) (Text replacement - "</source>" to "</syntaxhighlight>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

← Chapter 2 ChallengesHomeChapter 3:The Shell Variables and Environment →

  • Write a program that prints your favorite movie name. It should print director name on the next line.
#!/bin/bash
echo "The Shawshank Redemption"
echo "Frank Darabont"

  • Write a shell script that prints out your name and waits for the user to press the [Enter] key before the script ends.
#!/bin/bash
echo "Vivek Gite"
read -p "Press [Enter] key to continue..." fakeEnterKey

  • List 10 builtin and external commands.

A: Use type command and which command to find out builtin and external commands.


  • cd to /etc/init.d and view various system init scripts.
cd /etc/init.d
ls
vi ssh

← Chapter 2 ChallengesHomeChapter 3:The Shell Variables and Environment →