Question

If the user types “ls –a –l ” into the shell, what will argc’s value be?...

If the user types “ls –a –l ” into the shell, what will argc’s value be? What will the C strings pointed to by argv contain, assuming the bottom of the array is 0?

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

The command is -------- ls -a -l

ls is the command name and it is the first argument

argv[0] = ls

argv[1] = -a

argv[2] = -l

argument count argc = 3

Add a comment
Know the answer?
Add Answer to:
If the user types “ls –a –l ” into the shell, what will argc’s value be?...
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
  • Overview Writing in the C language, implement a very basic shell, called smash. In this project,...

    Overview Writing in the C language, implement a very basic shell, called smash. In this project, we will work on processing strings and using the appropriate system calls. Build System setup Before we can start writing code we need to get our build system all setup. This will involve writing a very simple makefile. You should leverage your Makefile project for this part of the assignment! Write a Makefile that provides the three targets listed below all - The default...

  • what do the following shell commands do 1) rm Project* 2) ls File[0-9][0-9] 3) rm [A-Z]???

    what do the following shell commands do 1) rm Project* 2) ls File[0-9][0-9] 3) rm [A-Z]???

  • ​​​​​​This program will make Maze game. Please Help in c++ Prompt the user for a file...

    ​​​​​​This program will make Maze game. Please Help in c++ Prompt the user for a file that contains the maze. Read it into a two-dimensional array Remember you can use inputStream.get(c) to read the next character from the inputStream. This will read whitespace and non-whitespace characters Don’t forget to read the newline character at the end of each line Print the maze to the screen from your array You should include a ‘*’ in your maze to indicate where the...

  • What are the two types of user-defined functions? Discuss two differences between the two types of...

    What are the two types of user-defined functions? Discuss two differences between the two types of user defined functions Describe two benefits of using a user defined functions in a program.program.

  • Sandy is a member of the managers group. Consider carefully the output of ls -l. What...

    Sandy is a member of the managers group. Consider carefully the output of ls -l. What operations can she perform on the file shown below? (A) Read, write and execute (B) Read only (C) Execute only (D) Read and execute only

  • I have included what I need to do for part b, and what I have so...

    I have included what I need to do for part b, and what I have so far. I 2.2 Part B Write a default version of program to report the behavior of the Linux kernel by inspecting kernel state. The program should print the following values to the user screen or console: CPU type and model Kernel version Amount of time since the system was last booted, in thefomdmm:5s (for example, 3 days 13 hours 46 minutes 32 seconds would...

  • lab software using cygwin part1 part2 1 of 1 1. Write a shell program name it...

    lab software using cygwin part1 part2 1 of 1 1. Write a shell program name it "lab4q1.sh" to compare the two strings: a. Read the first string. b. Read the second string. c. If the strings are empty print "String Empty" and exit using the statement exit 1. d. Compare the two strings using the if and print longer string. e. If the size of both strings is same, then print that two strings are equal (use printf), otherwise, print...

  • Problem 1: Dynamic Grocery Array Using Java to write a program that prompts the user to...

    Problem 1: Dynamic Grocery Array Using Java to write a program that prompts the user to enter an item’s name for each position in the array. The program then prints uses a loop to output the array. Example 1: Banana 2: Orange 3: Milk 4: Carrot 5: Chips Banana, Orange, Milk, Carrot, Chips Problem 2: Print Characters in String Array    Declare a string array of size 5. Prompt the user enters five strings that are stored in the array....

  • Revision Question 3 on Linux. Please explain the shell script commands in the context of post...

    Revision Question 3 on Linux. Please explain the shell script commands in the context of post execution. You have just logged in and have a directory called "novel" in your home directory containing the following files: chapter1.docx chapter2.docx chapter3.docx draft.pdf save where "save" is itself a directory and contains the files Attributes.txt draft.pdf.1 draft.pdf.2 draft.pdf.3 indexA.txt indexB.txt list1.txt list2.txt a) Describe the results you would expect when executing the following shell commands: i) ls novel/save/*A* ii) ls novel/*r[23]* iii) rmdir...

  • c++ language Consider the series of numbers beginning at user-specified start and running up to but...

    c++ language Consider the series of numbers beginning at user-specified start and running up to but not including user-specified end, so for example start=1 and end=5 gives the series 1, 2, 3, 4. Return a new string[] array containing the string form of these numbers (e.g. "one", "two", "fifty-three" etc., except for multiples of 3, use "Fizz" instead of the number, for multiples of 5 use "Buzz", and for multiples of both 3 and 5 use "FizzBuzz". Test with numbers...

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