Question

in Linux, BASH Shell Write a while loop script called count that counts and prints the...

in Linux, BASH Shell

Write a while loop script called count that counts and prints the numbers 0 thru 9 without issuing a new line after each output.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
count=0
while [[ ${count} -lt 10 ]]
do
   echo -n "$count "
   count=$(( count + 1 ))
done
echo ""

Add a comment
Know the answer?
Add Answer to:
in Linux, BASH Shell Write a while loop script called count that counts and prints the...
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
  • Please write a bash script for the following two questions, thank you.    Write a shell script...

    Please write a bash script for the following two questions, thank you.    Write a shell script “6-1.sh” to calculate the exponentiation using while loop. This script needs to take two inputs like “6-1.sh a b”, and outputs the result of “ab”. Note: You need to implement it, DO NOT use the exponentiation operation provided by the Linux.    Write a shell script “6-2.sh” to calculate the factorial of a number using while loop. This script needs to take one input...

  • How to write a bash shell script that prints a hollow box after user enters number...

    How to write a bash shell script that prints a hollow box after user enters number of lines, ie "bash hbox 4" , prints: **** *   * *   * **** My code doesnt work. i need it to take in the argument from the command line: ./hbox 4 "*" echo "Enter number of rows" read sz clear for (( x = 1; x <= $sz; x++ )); do     for (( y = 1; y <= $sz; y++ )); do...

  • Homework No.2 CSC 222 Write a shell script program called "countf.sh" that will count how many...

    Homework No.2 CSC 222 Write a shell script program called "countf.sh" that will count how many files or directories recursively. beside the file counts, also report how many files for each types (directory or regular files). It will either take arguments for specific directories and no argument. If no argument, it will read the current working directory as the starting point. Please also provide -h option to print out how to use your countf.sh program % ./countf.sh % ./countf.sh file1...

  • I need this done ASAP. Please write a bash shell script that does the following: Prints...

    I need this done ASAP. Please write a bash shell script that does the following: Prints out how many users are logged on. This can be accomplished using who and wc. Prints out a list of currently logged on users. This can be accomplished using who, grep, regular expressions, and echo. Prints out how many processes you have running from past days, and a list of those jobs. Use `whoami` to get your username. Run ps -ef and see how...

  •        Write a shell script “6-1.sh” to calculate the exponentiation using while loop. This script needs...

           Write a shell script “6-1.sh” to calculate the exponentiation using while loop. This script needs to take two inputs like “6-1.sh a b”, and outputs the result of “ab”. Note: You need to implement it, DO NOT use the exponentiation operation provided by the Linux.        Write a shell script “6-2.sh” to calculate the factorial of a number using while loop. This script needs to take one input like “6-2.sh a”, and outputs the result of “a!”.

  • Write a script using the bash shell to add new users to the system. The script...

    Write a script using the bash shell to add new users to the system. The script should read user information from a comma-delimited file (each field should be separated by a comma). The filename should be passed to the script as a command-line argument. Be sure the script contains a usage clause. The input file should contain the user information with one user per line. As the system administrator, you should determine the information necessary for each user to properly...

  • Write a Bash shell script testaverager.sh that will determine if a person has passed a class....

    Write a Bash shell script testaverager.sh that will determine if a person has passed a class. It should take in as a command-line parameter a name (first and last name) as well as a series of numbers. This list could be of any length. Your script should start by calculating the average of the scores. If the result is below 70, it should output “Sorry [name] but you will have to retake the class!”. If the result is 70 or...

  • Write a bash shell script to carry out each of the following tasks: What to Do:...

    Write a bash shell script to carry out each of the following tasks: What to Do: a. Safe Delete: When you use the “rm” command in Linux, it will delete the specified files, with no chance for recovering them back later. Write a script (called srm) that will safely delete the files passed to it as command-line arguments. For example, typing the command: “srm file1 file2 file3”, the script shall not actually delete these files, but instead it shall move...

  • Note this: : 2. Write a bash script that reads two numbers x and y and...

    Note this: : 2. Write a bash script that reads two numbers x and y and performs addition, subtraction, multiplication, and division of the two numbers (x+y, x-y, x*y, x/y) and prints out each of these values along with some text to indicate what these numbers are. Submit as a shell script file that can be run. (25x4]

  • Write a bash shell script to print the number of command line arguments and list of...

    Write a bash shell script to print the number of command line arguments and list of command line arguments 3. 12]

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