Question

I need a simple explanation of WHY the output is what it is -- Unix/Linux shell...

I need a simple explanation of WHY the output is what it is -- Unix/Linux shell programming I am taking this introductory course in college

echo * CIS132 **

echo "\\"

echo $t1 variable t1=$t{1}\!\\n

echo -e $t1 variable t1=$t{1}\!\\n

Thanks for the explanations.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


PLEASE FIND THE ANSWERS BELOW.

  

  1. echo *CIS132**
    • It will print *CIS132** because whatever STRING we write after echo, it will display it.
  2. echo "\\"
    • It will print \ because \ (forward slash) is an escape sequence character. If we want to output a single forward slash, we use \\ to print it.
  3. echo $t1 variable t1=$t{1}\!\\n
    • It will print echo $t1 variable t1=$t{1}!\n
    • Reason:
      • There is no -e. So, it will print the string it was given.
      • As discussed above to print a special character, we use / before it. There is a / before /n . Hence, it prints \n
  4. echo -e $t1 variable t1=$t{1}\!\\n
    • It will print echo $t1 variable t1=$t{1}!
    • Reason:
      • ​​​​​​​-e option will interpret the \n as new line. So, it prints a new line after the output.

The outputs are given below:

Add a comment
Know the answer?
Add Answer to:
I need a simple explanation of WHY the output is what it is -- Unix/Linux shell...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT