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
  • Can you help me? I am taking an INTRODUCTORY unix/linux shell programming course and need to...

    Can you help me? I am taking an INTRODUCTORY unix/linux shell programming course and need to know what the following command will do. Need a SIMPLE answer please. onsystem john1 &

  • I am taking an introductory course in unix/linux shell programming and need some help. Can you...

    I am taking an introductory course in unix/linux shell programming and need some help. Can you tell me what command I would use to make the variable myName readable by child process

  • I need some help with the cp command in Unix/Linux. I need to copy all the...

    I need some help with the cp command in Unix/Linux. I need to copy all the files in my current directory A03 into the backup directory. How do I do this? I am taking an introductory unix/linux course so I need a basic answer. Thanks.

  • I am a college student taking an INTRODUCTORY linux shell programming course and need some help...

    I am a college student taking an INTRODUCTORY linux shell programming course and need some help with writing a for statement. How would I write a for statement to process all the arguments at the command line and indicate if the argument contains the name of a student in my class. The names of the students are in the file cis132students.   I realize you do not have the file but if you could write it I could see if it...

  • I am a college student taking an intro to linux shell programming course and need some...

    I am a college student taking an intro to linux shell programming course and need some help with this question. I need to write an until statement as indicated: Check to see if the file cis132 exists in the current directory. If it does not a message will be printed every 10 seconds indicating that file does not exist. Once the file is created the message will stop. Thanks for your help.

  • I am in need of some help with UNIX/Linux, particularly sed and awk: Please help me...

    I am in need of some help with UNIX/Linux, particularly sed and awk: Please help me Display from /etc/passwd a list of users and their shells for those using the Korn shell or Bash shell. Order the output by the absolute pathname of the shell used. Thank you.

  • UNIX/LINUX Help. I need to modify this script so that the output of the file name...

    UNIX/LINUX Help. I need to modify this script so that the output of the file name is changed from you_someAssignment.txt to You.someAssignment.txt. #!/bin/sh if [ $# -eq 1 ]; then STUDENTNAME=$USER ASSIGNMENT=$1 else echo "usage: `basename $0` [assignment]" exit 1 fi if [ ! -d "$ASSIGNMENT" ]; then # Control will enter here if $ASSIGNMENT doesn't exist. mkdir $ASSIGNMENT fi # Move into the directory cd $ASSIGNMENT # Variable for the filename FILENAME=$USER\_$ASSIGNMENT.txt HOST=$(hostname) DATE=$(date +"%m-%d-%Y") TIME=$(date +"%r") if [...

  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • I am using VIM UNIX/Linux commandline program. I need the lines of code that will make...

    I am using VIM UNIX/Linux commandline program. I need the lines of code that will make the program return an exit code of zero for normal execution and an exit code of 1 for abnormal execution.

  • I am a college student and need some help with this homework problem. I am taking...

    I am a college student and need some help with this homework problem. I am taking an introductory Operating Scripting course (windows 10) I need to create a batch file named UserInfolog.bat.   Instead of displaying the output to the screen, redirect all output to a file named computername.log and it must be created each time the batch file is executed.   After redirecting the output to the log file, the batch file must display that file's contents in the command prompt...

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