answersLogoWhite

0


Best Answer

The use of the "for" loop in many shell scripting languages to do what you want would be fairly confining. However, if you wanted to do that, you could, for example, do the following:

for i in 1 2 3 4 5 6 7 8 9 10

do

echo $i

done

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: To print first 10 numbers in unix shell scripting using FOR loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is bash shell scripting?

Bash shell scripting is the process of writing a series of commands in a text file that are recognized by the bash shell interpreter.


What is shell scripting?

Shell scripting is scripting that uses the Windows Script Host shell. While the above answer may be true for Windows based systems, for Unix and Unix-like systems shell scripting is the ability to create a file of commands and to have them executed automatically, including unattended operation. It is used in the cases where one wishes to automate a process with a given series of commands to be used many times. Shell scripting allows one to automate processes, thereby reducing errors and misspellings by putting the commands in a file and telling the system to execute the commands.


Explain unix shell scripting commands in detail?

This depends widely on the actual shell environment you are using. I suggest you take a look at the YouTube videos, which cover the various scripting elements in detail.


Difference between perl scripting and shell scripting?

Perl is a scripting language. It is not, however, a shell scripting language because Perl is not a shell program. A shell program is one that usually interacts with a user and provides certain user interface abilities. Perl was not designed for that purpose. You can certainly program a shell to operate in various fashions. A shell script is usually provided for redundant tasks and series of commands, unattended operation, and so forth. Perl is a "kitchen sink" of ways to interact with data, databases, networks, and so forth. It is a great language for manipulating text in various ways.


How do you write a statement in DOS using shell script to display a word?

We can not perform Shell Scripting in DOS, we can do Batch programing in DOS..


I am currently using windows XP2. For practice purpose i want to use UNIX shell scripting. Without installing UNIX OS how can i use the UNIX shell scripting?

You should be able to download the Unix Services for Windows, version 3.5, from Microsoft (free). There are other shell emulators that are available for Windows, which would allow you to use Unix type shell scripting without installing any additional OS. Your question about "virtual UNIX" is unclear ..


How do you write functions in Linux shell scripting?

It can depend on which shell environment you are using, but what I use is: function something { # body of routine } # call the function something


What command in a script would print on the screen the first variable past to that script?

Well the question is not particularly specific. I assume that we are talking about shell and in this example I would refer to "bash" shell. #!/bin/bash echo $1 this simple script will print first parameter passed to it.


Shell script to find out the sum of first 10 natural numbers?

Yes


What is the shell script program for adding five digit numbers?

It depends upon which language you intend to write your script, however 5 digit numbers are simply numeric value and any scripting language that supports basic arithmetic operators will be able to achieve this easily. The hardest part is converting the user input (which is typically a character sequence) into an actual number, however most scripting languages will provide some means of converting strings to numeric values.


Can a sea shell have an animal print on it?

No. If you have found a hard rock with an animal print on it, it may be a fossil.


How do you print the current directory in shell program?

pwd