Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Faster than nested while read loops? Post 302545791 by jim mcnamara on Tuesday 9th of August 2011 01:52:28 PM
Old 08-09-2011
The fastest way, arguably, to read a file is process substitutuion in bash, ksh, or zsh.

Code:
a=$(< filename)
b=$(< filename2)

But based on his example and output it looks like he is pasting.
 

10 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

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

4. Shell Programming and Scripting

Need help with Regular Expressions and nested loops

Ok... am going slightly loopy trying to get this working (no pun intended) What I need is to modify this code which takes a string input then echo's each character on a seperate line, to do the same thing but to put DIGIT: in front of numbers and LETTER: in front of letters. I know a regular... (5 Replies)
Discussion started by: U_C_Dispatj
5 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. 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

10. UNIX for Beginners Questions & Answers

Nested Loops for text file

Hi A text file containing data something likeVehicle: BMW Class checkin_note: Tyre : Four path_id : 11 vault_file_size: -1 Vehicle: Toyota Class checkin_note: Tyre : Four path_id : 11 vault_file_size: -1 Vehicle: Chevrolet Class checkin_note: Tyre : Five path_id :... (7 Replies)
Discussion started by: vipinHasija
7 Replies
show group(1m)															    show group(1m)

NAME
show group - Shows the members of a group SYNOPSIS
rpccp show group group-entry-name [-m member] [-r [ integer]] [-s syntax] [-u] OPTIONS
Declares the name of a single group member. Indicates that the show group operation recurses. If any members of a group are also groups, their entries are shown. By default, the -r option causes the show group operation to recurse until all nested groups are expanded; for example, -r shows the members of the specified group and all nested groups. You can limit recursion to one or more levels by specifying a decimal integer as part of the -r option. For example, -r 1 shows the members of the specified group and, for members that are groups, the command also shows their members; then recursion stops. Without the -r option, only the members of the specified group are shown. Indicates the name syntax of the entry name (optional). The only value for this option is the dce name syntax, which is the default name syntax. Until an alternative name syntax becomes available, speci- fying the -s option is unnecessary. Updates the local CDS cache copy of name service data (optional). Name service data is cached locally on each machine in a cell. If an rpccp inquiry can be satisfied by data in the local CDS cache, this cached data is returned. Locally cached copies of name service data might not include a recent CDS update, however. If the required data is not available in the local CDS cache, rpccp goes to a CDS server(s) to retrieve the required data. rpccp then updates the local CDS cache. Using the -u option bypasses the local cache, allowing rpccp to go directly to a CDS server for the inquiry. rpccp then updates the local CDS cache. ARGUMENTS
Indicates the name of the target group. For an entry in the local cell, you can omit the cell name and specify only the cell-relative name. DESCRIPTION
The show group command shows the members of a group in the name service database. The entry name of the group is required. Unless it is limited to a specific member (by the -m option), the show group command shows all members. The command shows only the members in the spec- ified group; the -r option enables you to show members of nested groups. Privilege Required You need read permission to the CDS object entry (the target group entry). If you use the -r option, you also need read permission to any nested groups. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The following example shows all the members of the group /.:/LandS/anthro/Calendar_group, in the order in which they were added to the group: $ rpccp rpccp> show group /.:/LandS/anthro/Calendar_group The following command operates from the system prompt to show a specific member of the group /.:/LandS/dept/Calendar_group: $ rpccp show group > -m /.:/LandS/anthro/Cal_host_2 > /.:/LandS/anthro/Calen- dar_group RELATED INFORMATION
Commands: add member(1m), remove group(1m), remove member(1m) show group(1m)
All times are GMT -4. The time now is 04:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy