Sponsored Content
Top Forums Shell Programming and Scripting For loop statements order of operations Post 303023766 by Scott on Friday 21st of September 2018 09:46:08 PM
Old 09-21-2018
You're reading the file in sequential order. The order of your if statements is unimportant for the requirement you specified.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String Operations

Hi All, Query 1 : I want to know how we can get a count of multipe occurrences of a particular expression in another string. For Eg. If my string is " 12" and i need to count the number of spaces preceeding 12 Query 2 : Also want to know how we can change the alignment of a... (9 Replies)
Discussion started by: Rohini Vijay
9 Replies

2. UNIX for Dummies Questions & Answers

File operations

Hi I have a tab delimited file with 3 fields. I need to sort this file on the first field and remove all the records where the first field has dulplicates. For eg my file is 133|arrfdfdg|sdfdsg 234|asfsdgfs|aasdfs 133|affbfsde|dgfg When this file gets sorted I need the result to be ... (2 Replies)
Discussion started by: monks
2 Replies

3. Shell Programming and Scripting

for i loop with conditional statements?

New to scripting in general, so patience plz. If I ask a stupid question or don't get it, I thank you for your kindness in advance. That said, did a for i loops checks to see if a PB* file is there but I need to know two things before I copy the file. I need to know if the file's create date... (2 Replies)
Discussion started by: xgringo
2 Replies

4. Shell Programming and Scripting

is that possible to keep statements in any loop??

Hi, Actually i stored all validdisks in one array and corresponding partitions required for all individual disks in other array.. Example: Validdisks=dsk2 dsk3 dsk5 ValidPartition=4 4 3 Now i have to create domain.. Domain creation can be done by below commands: fs_setup -d... (1 Reply)
Discussion started by: mansa
1 Replies

5. Shell Programming and Scripting

How to execute a no of SELECT COUNT(*) statements using a loop

HI Unix Gurus, I have a number of SELECT count(*) statements in an input file and I want to execute it using a shell script but one by one using loop in script.... How can I do this..... (7 Replies)
Discussion started by: ustechie
7 Replies

6. Shell Programming and Scripting

String operations

Hi All, can you tell me how to drop all preceding zeros in a number. For example, if i have a numbers like 000876838347 and 0000007854762543..how to make them as 876838347 and 7854762543. (6 Replies)
Discussion started by: nram_krishna@ya
6 Replies

7. Shell Programming and Scripting

String operations

Can you give me some suggestions to split below string into three parts using shell scripts.. Script has to print all alphabets before the number, then number and then all alphabets after the number.. input: chris martin 200173 845747 mech engineer output: chris martin 200173 845747 mech... (6 Replies)
Discussion started by: nram_krishna@ya
6 Replies

8. UNIX for Dummies Questions & Answers

Loop Through Files in Order and mapping

Hi there, How can I loop through files with order. I tried using ls .html | sort -v However the filename is with spaces:1233.61.47.0 - 121.61.123.112 nexpose.html Here is the original code that is working well, but I need to sort through the filename.echo "<center>" for file in *.html... (2 Replies)
Discussion started by: alvinoo
2 Replies

9. Shell Programming and Scripting

2 statements in for loop

Bash shell, variables i and rem are working fine in 2 separate for loops, but I'd like to consolidate them like this: for && This gives syntax error on &&. Thanks in advance for direction. (5 Replies)
Discussion started by: p1ne
5 Replies

10. Shell Programming and Scripting

Bash directory loop and order by creation date?

Hello, how in bash i can get directory loop and order by creation date? THX! :) #!/bin/bash for folder in /home/test/* do if ; then echo $folder; fi (12 Replies)
Discussion started by: ZerO13
12 Replies
COLLDEF(1)						    BSD General Commands Manual 						COLLDEF(1)

NAME
colldef -- convert collation sequence source definition SYNOPSIS
colldef [-I map_dir] [-o out_file] [filename] DESCRIPTION
The colldef utility converts a collation sequence source definition into a format usable by the strxfrm() and strcoll() functions. It is used to define the many ways in which strings can be ordered and collated. strxfrm() transforms its first argument and places the result in its second argument. The transformed string is such that it can be correctly ordered with other transformed strings by using strcmp(), strncmp(), or memcmp(). strcoll() transforms its arguments and does a comparison. The colldef utility reads the collation sequence source definition from the standard input and stores the converted definition in filename. The output file produced contains the database with collating sequence information in a form usable by system commands and routines. Options list: -I map_dir This option set directory name where charmap files can be found, current directory by default. -o out_file This option set output file name, LC_COLLATE by default. The collation sequence definition specifies a set of collating elements and the rules defining how strings containing these should be ordered. This is most useful for different language definitions. The specification file can consist of three statements: charmap, substitute and order. Of these, only the order statement is required. When charmap or substitute is supplied, these statements must be ordered as above. Any statements after the order statement are ignored. Lines in the specification file beginning with a # are treated as comments and are ignored. Blank lines are also ignored. charmap charmapfile charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found. The format of charmapfile is shown below. Symbol names are separated from their values by TAB or SPACE characters. symbol-value can be spec- ified in a hexadecimal (x??) or octal (???) representation, and can be only one character in length. symbol-name1 symbol-value1 symbol-name2 symbol-value2 ... The charmap statement is optional. substitute symbol with "repl_string" The substitute statement substitutes the character symbol with the string repl_string. Symbol names cannot be specified in repl_string field. The substitute statement is optional. order order_list order_list is a list of symbols, separated by semi colons, that defines the collating sequence. The special symbol ... specifies, in a short-hand form, symbols that are sequential in machine code order. An order list element can be represented in any one of the following ways: o The symbol itself (for example, a for the lower-case letter a) o The symbol in octal representation (for example, 141 for the letter a) o The symbol in hexadecimal representation (for example, x61 for the letter a) o The symbol name as defined in the charmap file (for example, <letterA> for letterA 23 record in charmapfile). If character map name have > character, it must be escaped as />, single / must be escaped as //. o Symbols a, , f, , , v are permitted in its usual C-language meaning o The symbol chain (for example: abc, <letterA><letterB>c, xf1bxf2) o The symbol range (for example, a;...;z) o Comma-separated symbols, ranges and chains enclosed in parenthesis (for example ( sym1, sym2, ... )) are assigned the same primary order- ing but different secondary ordering. o Comma-separated symbols, ranges and chains enclosed in curly brackets (for example { sym1, sym2, ... }) are assigned the same primary ordering only. The backslash character is used for continuation. In this case, no characters are permitted after the backslash character. DIAGNOSTICS
The colldef utility exits with the following values: 0 No errors were found and the output was successfully created. !=0 Errors were found. FILES
/usr/share/locale/<language>/LC_COLLATE standard shared location for collation orders under the locale locale SEE ALSO
mklocale(1), setlocale(3), strcoll(3), strxfrm(3) BSD
January 27, 1995 BSD
All times are GMT -4. The time now is 02:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy