Sponsored Content
Homework and Emergencies Homework & Coursework Questions Alternative solution to nested loops in shell programming Post 302955805 by Sandeep Pattnai on Monday 21st of September 2015 07:35:51 PM
Old 09-21-2015
Hi Corona688/Rudi C,

As per your suggestion, I have changed the tr -d with the "sed" to remove spaces. But still I am seeing the same performance. Could you please suggest some alternate solution to this problem?

Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grepping within nested for loops

Good morning - I have publication lists from 34 different faculty members. I need to end up with the numbers of publications in common across all 34 faculty. I need to grep person1 (last name) in list2, person1 in list3, person1 in list 4, etc., then person2 in list3, person 2 in list4, etc.,... (2 Replies)
Discussion started by: Peggy White
2 Replies

2. Shell Programming and Scripting

nested for loops

I need help getting over this bump on how nested for loops work in shell. Say i was comparing files in a directory in any other language my for loop would look like so for(int i=0;to then end; i++) for(int y = i+1; to the end; y++) I can't seem to understand how i can translate that... (5 Replies)
Discussion started by: taiL
5 Replies

3. Shell Programming and Scripting

Korn Shell programming (FTP, LOOPS, GREP)

Hello All, I have another Korn shell question. I am writing a script that will ftp a file from my production database to my test database. To this, I have to construct a loop that checks a specified folder for a file. If the file exists, I want it execute the ftp protocol and then exit. ... (2 Replies)
Discussion started by: jonesdk5
2 Replies

4. Shell Programming and Scripting

Nested while loops (ksh scripting)

You can use one while inside another? I made the following script (without really knowing if I can use two while) to get 3 numbers different from each other at random: num1=$(( $RANDOM % 10 )) num2=$num1 while do num2=$(( $RANDOM % 10 )) done num3=$num1 while do while do... (1 Reply)
Discussion started by: ale.dle
1 Replies

5. Shell Programming and Scripting

KSH nested loops?

KSH isn't my strong suit but it's what my company has to offer. I've got a script with two nested loops, a FOR and UNTIL, and that works fine. When I add a CASE into the mix I end up getting "Unexpected 'done' at line xx" errors. Any suggestions on this? for divi in at ce ci cm co de di fl... (9 Replies)
Discussion started by: mrice
9 Replies

6. UNIX for Dummies Questions & Answers

Faster than nested while read loops?

Hi experts, I just want to know if there is a better solution to my nested while read loops below: while read line; do while read line2; do while read line3; do echo "$line $line2 $line3" done < file3.txt done < file2.txt done < file1.txt >... (4 Replies)
Discussion started by: chstr_14
4 Replies

7. Shell Programming and Scripting

Nested for loops

Greetings All, The following script attempts to enumerate all users in all groups in the group file(GROUP) and echo the following information: GROUP ---> USER The script is as follows: IFS="," for GROUP in `ypcat -k group | cut -d" " -f1` do for USER in `ypcat -k group... (13 Replies)
Discussion started by: jacksolm
13 Replies

8. UNIX for Dummies Questions & Answers

Executing nested loops+foreach

It's been a while since I used csh formatting and I am having a little bit of trouble with a few things. Things seem so much easier to execute in Matlab, however I need to do this on the terminal because of the programs I am trying to interact with. So here's what I want to do: I have a file... (0 Replies)
Discussion started by: katia
0 Replies

9. Shell Programming and Scripting

two while nested loops

for server in $(echo `cat /tmp/ScanHosts_${USERSNAME}.TXT`) do for portnumber in $(echo `cat /tmp/ScanPorts_${USERSNAME}.TXT`) do #echo ${server} ${portnumber} ... (3 Replies)
Discussion started by: SkySmart
3 Replies
CVSBUG(8)						      System Manager's Manual							 CVSBUG(8)

NAME
cvsbug - send problem report (PR) about CVS to a central support site SYNOPSIS
cvsbug [ site ] [ -f problem-report ] [ -t mail-address ] [ -P ] [ -L ] [ --request-id ] [ -v ] DESCRIPTION
cvsbug is a tool used to submit problem reports (PRs) to a central support site. In most cases the correct site will be the default. This argument indicates the support site which is responsible for the category of problem involved. Some sites may use a local address as a default. site values are defined by using the aliases(5). cvsbug invokes an editor on a problem report template (after trying to fill in some fields with reasonable default values). When you exit the editor, cvsbug sends the completed form to the Problem Report Management System (GNATS) at a central support site. At the support site, the PR is assigned a unique number and is stored in the GNATS database according to its category and submitter-id. GNATS automati- cally replies with an acknowledgement, citing the category and the PR number. To ensure that a PR is handled promptly, it should contain your (unique) submitter-id and one of the available categories to identify the problem area. (Use `cvsbug -L' to see a list of categories.) The cvsbug template at your site should already be customized with your submitter-id (running `install-sid submitter-id' to accomplish this is part of the installation procedures for cvsbug). If this hasn't been done, see your system administrator for your submitter-id, or request one from your support site by invoking `cvsbug --request-id'. If your site does not distinguish between different user sites, or if you are not affiliated with the support site, use `net' for this field. The more precise your problem description and the more complete your information, the faster your support team can solve your problems. OPTIONS
-f problem-report specify a file (problem-report) which already contains a complete problem report. cvsbug sends the contents of the file without invoking the editor. If the value for problem-report is `-', then cvsbug reads from standard input. -t mail-address Change mail address at the support site for problem reports. The default mail-address is the address used for the default site. Use the site argument rather than this option in nearly all cases. -P print the form specified by the environment variable PR_FORM on standard output. If PR_FORM is not set, print the standard blank PR template. No mail is sent. -L print the list of available categories. No mail is sent. --request-id sends mail to the default support site, or site if specified, with a request for your submitter-id. If you are not affiliated with site, use a submitter-id of net'. -v Display the cvsbug version number. Note: use cvsbug to submit problem reports rather than mailing them directly. Using both the template and cvsbug itself will help ensure all necessary information will reach the support site. ENVIRONMENT
The environment variable EDITOR specifies the editor to invoke on the template. default: vi If the environment variable PR_FORM is set, then its value is used as the file name of the template for your problem-report editing ses- sion. You can use this to start with a partially completed form (for example, a form with the identification fields already completed). HOW TO FILL OUT A PROBLEM REPORT
Problem reports have to be in a particular form so that a program can easily manage them. Please remember the following guidelines: o describe only one problem with each problem report. o For follow-up mail, use the same subject line as the one in the automatic acknowledgement. It consists of category, PR number and the original synopsis line. This allows the support site to relate several mail messages to a particular PR and to record them automati- cally. o Please try to be as accurate as possible in the subject and/or synopsis line. o The subject and the synopsis line are not confidential. This is because open-bugs lists are compiled from them. Avoid confidential information there. See the GNU Info file cvsbug.info or the document Reporting Problems With cvsbug for detailed information on reporting problems HOW TO SUBMIT TEST CASES, CODE, ETC. Submit small code samples with the PR. Contact the support site for instructions on submitting larger test cases and problematic source code. FILES
/tmp/p$$ copy of PR used in editing session /tmp/pf$$ copy of empty PR form, for testing purposes /tmp/pbad$$ file for rejected PRs INSTALLATION AND CONFIGURATION
See INSTALL for installation instructions. SEE ALSO
gnats(l), query-pr(1), edit-pr(1), gnats(8), queue-pr(8), at-pr(8), mkcat(8), mkdist(8). AUTHORS
Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus Support) COPYING
Copyright (c) 1992, 1993 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. February 1993 xVERSIONx CVSBUG(8)
All times are GMT -4. The time now is 12:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy