Sponsored Content
Top Forums Shell Programming and Scripting print number pyramid with for loop in unix Post 302420377 by joshilalit2004 on Tuesday 11th of May 2010 11:54:56 AM
Old 05-11-2010
Thanks for the reply...

I am looking for the same programe with the for loop....I cannot use while loop......and I have to run the programe in ksh.....

Thanks in advance..
 

10 More Discussions You Might Find Interesting

1. HP-UX

Print Problem in UNIX. Need to know the option to specify the print paper size

Hi, Could any one please let me know what is the option available in UNIX to print by specifying the paper size? We are using Unix11i. I could n't see any option specified in the 'lp' command to print the report by specifying the size of the paper. It would be of great help to me, if... (1 Reply)
Discussion started by: ukarthik
1 Replies

2. UNIX for Dummies Questions & Answers

How to ignore characters and print only number using unix?

say D45H E67H G779K F8888U T66Y Y333U output shud be like 45 67 779 8888 66 333 (5 Replies)
Discussion started by: cdfd123
5 Replies

3. Shell Programming and Scripting

to print number one less than actual number

suppose we have a file which contains 34 45 56 77 55 66 54 67 so output shud be like 33 44 55 76 54 65 53 66 (4 Replies)
Discussion started by: cdfd123
4 Replies

4. UNIX for Dummies Questions & Answers

How do you print the number of processes that each user is currently running in Unix?

Ok, so I know there's a way to do this, but I've been trying to find out all afternoon with no luck. I think it should print out something like this: 1 bin 2 daemon 6 duo Where the numbers on the left are the number of processes being run by the user whose name is listed on the right. Is... (4 Replies)
Discussion started by: Duo11
4 Replies

5. Shell Programming and Scripting

Perl : print the sequence number without missing number

Dear Perl users, I need your help to solve my problem below. I want to print the sequence number without missing number within the range. E.g. my sequence number : 1 2 3 4 5 6 7 8 11 12 13 14 my desired output: 1 -8 , 11-14 my code below but still problem with the result: 1 - 14 1 -... (2 Replies)
Discussion started by: mandai
2 Replies

6. Shell Programming and Scripting

AWK print number of records, divide this number

I would like to print the number of records of 2 files, and divide the two numbers awk '{print NR}' file1 > output1 awk '{print NR}' file2 > output2 paste output1 output2 > output awl '{print $1/$2}' output > output_2 is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies

7. Shell Programming and Scripting

Parsing log file and print latest number in loop

Hello All, I have an awk script which parses my log file and prints number grepping from a specific line/pattern, now i have to come with a shell script to continue reading the log untill the job is completed, which i would know while reading session log untill process encounters a final... (1 Reply)
Discussion started by: Ariean
1 Replies

8. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

9. AIX

UNIX ksh - To print the PID number and repeat count

This question is asked in an interview today that I have to return output with each PID number and the count of each PID number logged today. Here is the script that I have written. Can you confirm if that would work or not. The interviewer didn't said if my answer is correct or not. Can someone... (5 Replies)
Discussion started by: Subodh Kumar
5 Replies

10. UNIX for Beginners Questions & Answers

Print number of lines for files in directory, also print number of unique lines

I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with: wc -l *|sort 15263 Image.txt 16401 reference.txt 40459 richtexteditor.txt How can I also print the number of unique lines in each file? 15263 1401 Image.txt 16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
break(1)                                                           User Commands                                                          break(1)

NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop SYNOPSIS
sh break [n] continue [n] csh break continue ksh *break [n] *continue [n] DESCRIPTION
sh The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels. The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop. csh The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line. The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop. ksh The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be exited. The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n- th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera- tion are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), exit(1), ksh(1), sh( 1), attributes(5) SunOS 5.10 17 Jul 2002 break(1)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy