Sponsored Content
Full Discussion: KSH nested loops?
Top Forums Shell Programming and Scripting KSH nested loops? Post 302542045 by Shell_Life on Tuesday 26th of July 2011 01:03:22 PM
Old 07-26-2011
Please display your current code.
 

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

file reading in nested loops

I have to to read files simultaneously in two nested loops,but am getting error can anyone do the needful. useridFile=userIds.txt fname=kiran.txt exec<$useridFile while read line do echo "User IDs are..$line" USER_ID=$line REMOTE_DIR_LOCATION="/home/test/$USER_ID" SOURCE_DIR=$USER_ID... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

3. 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

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. 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

6. 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

7. 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

8. 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

9. Shell Programming and Scripting

ksh - Need Help Reducing Nested Loops

Hello, I pulled out some old code from an unfinished project the other day and wanted to stream line it better. I know anything beyond a double loop is usually bad practice, and I came up with some logic for later that would no longer require the first loop in the following code that works: ... (5 Replies)
Discussion started by: Azrael
5 Replies
PO4A-RUNTIME.7(7)					User Contributed Perl Documentation					 PO4A-RUNTIME.7(7)

NAME
po4a-runtime - po4a and runtime gettext translation without Autotools Introduction With po4a-build, po4a also includes support for adding translation of runtime script output messages using gettext but without requiring the package to adopt Autotools and the typical ./configure process. Using example Makefile snippets, packages can harness intltool with minimal effort. Layout Documentation translation should NOT use the same po/ directory as the runtime translation. Whilst runtime translation can use directories other than po/, it is usually easiest to go with the convention. Multiple languages Just a word on packages that use scripts in multiple programming languages. A common mix is Perl and shell. Note bene: gettext WILL get confused and omit strings from one or other language unless file extensions are used for whichever is the least problematic language. When using multiple languages, experiment with various settings in po/Makevars until you get all the strings you need in the POT file. In particular, specifying two languages in po/Makevars can be problematic. Instead of: # Don't do this: XGETTEXT_OPTIONS = -L Perl -L Shell --from-code=iso-8859-1 Consider renaming (or providing symlink(s) for) all files for one of the languages involved and omitting the explicit -L options. The file extension only needs to exist during the time that po/POTFILES.in is being processed. The --keywords option can also be useful - see the xgettext documentation. Populating po/ So, create your top level po/ directory and then use the example files in /usr/share/doc/po4a/examples/ to populate it. LINGUAS Must exist, even if empty. Consists of a list of translations - each line not starting with a '#' must match an existing PO file. e.g. if LINGUAS contains a single line, 'fr', an fr.po file must exist alongside the LINGUAS file. $ cat po/LINGUAS cs de fr $ By convention, the LINGUAS file is sorted alphabetically but that is a manual process. POTFILES.in The list of files containing the messages that need to be translated at runtime - i.e. your scripts. If you've used the top level po/ directory, the paths should be relative to the top level directory, not the po/ directory itself. $ ls -l myscript.pl another.pl foo/support.pl po/ po/POTFILES.in $ cat po/POTFILES.in myscript.pl another.pl foo/support.pl $ Note that it is explicitly supported that the scripts themselves can contain strings for both runtime and documentation translation, e.g. using gettext functions for runtime and embedded POD content for documentation. So it is not a problem to have the same file listed in po/POTFILES.in and doc/po4a-build.conf Makevars-perl.example If your scripts are in Perl, copy this example file as po/Makevars and edit it to suit. Makevars-shell.example If your scripts are in shell, copy this example file as po/Makevars and edit it to suit. po4a-build.make Copy this example file as po/Makefile - it shouldn't need editing but you may want to keep it updated against /usr/share/doc/po4a/examples/po4a-build.make as it may need to be updated within po4a releases as the underlying intltool support changes. (The file itself was generated from another project using Autotools and intltool.) Building These snippets need to be added to your top level Makefile or whatever other method you use to prepare your sources for distribution. clean: $(MAKE) -C po/ clean install: $(MAKE) -C po/ install DESTDIR=$(DESTDIR) dist: $(MAKE) -C po/ pot (In an Autotools project, this would happen automatically by simply adding po to the "SUBDIRS" value in Makefile.am.) Maintenance Runtime translation isn't quite as easy as po4a-build in that adding a new translation does require editing po/LINGUAS, but apart from that, updating translations is merely a case of replacing the relevant PO file with the new version. Depending on how you prepare your source tarball, you may also need to list new PO files in the MANIFEST file or add to the script(s) that prepare the tarball. (That also applies to po4a-build.) Any *.mo or *.gmo files in po/ can be deleted / cleaned up. Copyright Whilst the example files are part of the po4a project, you are free to use, modify and distribute them in your own projects without needing to refer back to po4a or list the po4a team in your own copyright notices, in the same manner as other build tools like Automake itself. If you want to mention po4a, that is fine too. AUTHORS
Neil Williams <linux@codehelp.co.uk> perl v5.14.2 2012-05-17 PO4A-RUNTIME.7(7)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy