Question

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.

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

Solution:

code:

echo peter
echo $?    # Since the command is executed successfully, this means that this will exit with zero

lskdf      # Unrecognized command.
echo $?    # In case of command is failed it will return with non-zero .

Please give it a thumbs up if this helped you, also provide your valuable feedback.

Add a comment
Know the answer?
Add Answer to:
I am using VIM UNIX/Linux commandline program. I need the lines of code that will make...
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
  • 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 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.

  • 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 &

  • Word count. A common utility on Unix/Linux systems. This program counts the number of lines, words...

    Word count. A common utility on Unix/Linux systems. This program counts the number of lines, words (strings of characters separated by blanks or new lines), and characters in a file (not including blank spaces between words). Write your own version of this program. You will need to create a text file with a number of lines/sentences. The program should accept a filename (of your text file) from the user and then print three numbers: The count of lines/sentences The count...

  • 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.

  • Using either a UNIX or a Linux system, write a C program that forks a child...

    Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Process states can be obtained from the command: ps -l The process states are shown below the S column; processes with a state of Z are zombies. The process identifier (pid) of the child process is listed in the PID column, and that of the parent is listed in the PPID column. Because you do not want...

  • Linux & Unix Write a bash program to indent the code in a bash source file....

    Linux & Unix Write a bash program to indent the code in a bash source file. Conditions:     The source file will contain only printing characters, spaces, and newlines. It is not necessary to check for invalid input.     The source file will not contain comments (words beginning with #). Requirements:     Read from standard input, write to standard output.     Code inside while statements should be indented 2 spaces. Be sure your program includes all of the following:    ...

  • I need help with ARM assembly program : Using the following code as basic : 1...

    I need help with ARM assembly program : Using the following code as basic : 1 ) Write a program code that is able to calculate the following : Result = A + ( B * C ) - D Place the result as the return value so you can print it afterwards in the command prompt. 2) This time, use MLA instruction to reduce the number of instructions in question 1. Place the result as the return value so...

  • Hello Experts, I need help with the following Operating System(Unix) question. Using node js as a...

    Hello Experts, I need help with the following Operating System(Unix) question. Using node js as a shell and using a Linux system please answer as briefly as possible with example if needed. will UPVOTE!! Q: When ssh runs commands on remote systems, does ssh directly execve the executable, or does it first call a shell which then runs the specified program? How can you verify this behavior?

  • (C++/Linux) I am a little confused as to what the first line in the main exactly...

    (C++/Linux) I am a little confused as to what the first line in the main exactly does. I am also in need of clarity about all the possibilities in the if statement and what they mean and correspond to (all in the code below). Thank you. #include <iostream> #include <unistd.h> int main() { pid_t id = fork(); if(id == -1) { std::cout << "Error creating process\n"; } else if (id == 0) { std::cout << "I am a child process!\n";...

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