Sponsored Content
Top Forums Shell Programming and Scripting Need help in sort variable in perl Post 302605054 by rocky1954 on Tuesday 6th of March 2012 02:02:14 PM
Old 03-06-2012
Hi,

Thanks for the reply

but the code you have given is not working for my condition

here is my requirement

variable1 = david3 david1

variable2 = david1 david3

i need to change variable1 like david1 david3

i need to use this as dynamic thing

please help me on this....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort function in perl

Hi, here is my perl script.This script creates an array and is sorting it using the in-built sort function in perl. #!/usr/local/bin/perl my number=6; my @num_arr=(1,2,3,4,5); my @array=(23,"$number","Hello",2.345,@num_arr); #printing the array print... (2 Replies)
Discussion started by: DILEEP410
2 Replies

2. Shell Programming and Scripting

Sort and Unique in Perl

Hi, May I know, if a pipe separated File is large, what is the best method to calculate the unique row count of 3rd column and get a list of unique value of the 3rdcolum? Thanks in advance! (20 Replies)
Discussion started by: deepakwins
20 Replies

3. Shell Programming and Scripting

unique sort contents of a variable

Hi , I have #echo $var1 #hdisk2 hdisk3 hdisk0 hdisk2 Now I need to remove duplicate entries from this . ie. after sorting it should only have hdisk2 hdisk3 hdisk0 . I can have these values in a array as well . I understand we can use sort -u to remove the duplicates in a... (2 Replies)
Discussion started by: praveenbvarrier
2 Replies

4. Shell Programming and Scripting

perl sort

Hi all, Say i have a array @array=("abc,"a",ab"); I would like to sort them according to the length. Any idea? thanks in advanced. i tried below code, but not work. sub sort_fun{ if (length shift(@_) >= length shift(@_) ){ return 1; } else{ return 0; } } (1 Reply)
Discussion started by: summer_cherry
1 Replies

5. Shell Programming and Scripting

how to do sort in perl?

Hi, Can anyone advise how to correct my script pls? I'm not getting the correct output =( Details below: Logfile ======== Player Num : 14 Player Name : Jacee Thirkins MVP winner : 1998 End of details.... Player Num : 35 Player Name : Lander Diaz MVP winner : 2002... (1 Reply)
Discussion started by: gholdbhurg
1 Replies

6. Shell Programming and Scripting

sort in perl

Hi Is there any way I could reproduce the following code in perl 5.8: sort -u FILE | sort -t: -k1,1 -k2n which sorts by unicity first, then by first key, then by second key in numeric format. What I have now is @sort_array=uniq sort @sort_array; after the contents of my... (5 Replies)
Discussion started by: Indalecio
5 Replies

7. UNIX for Advanced & Expert Users

Perl Sort

I am getting the problem to sort these input in perl. INPUT ------ Eddie-3 Michael-1 Nica-4 Montoya-6 Then the program should print the output as follows: OUTPUT ------- Michael-1 Eddie-3 Nica-4 Montoya-6 I am only able to sort to the words but I want to sort to numbers.. My... (5 Replies)
Discussion started by: mr_harish80
5 Replies

8. Shell Programming and Scripting

sort - perl

Hi, can I sort the fields on the basis of dates in the following format? from this Dec 17 2007 2:18:18:000PM Dec 17 2007 5:18:18:000AM Jan 19 2009 4:30:02:000AM Mar 21 2010 9:13:55:000AM Dec 16 2007 4:29:21:000PM Dec 24 2009 12:29:23:000PM to Dec 16 2007 4:29:21:000PM... (2 Replies)
Discussion started by: shellwell
2 Replies

9. Shell Programming and Scripting

Variable increment (of some sort)

i have a variable that has more than one value. i am declaring another variable, which will have the old variable data one by one. i want to use the second variable to hold the track of all the variable it has parsed from the first one. can somebody help me how do i declare and use the second... (7 Replies)
Discussion started by: gopajitmalakar
7 Replies

10. Shell Programming and Scripting

Including variable in sort command

I have the following awk statement that computes rank of a column and sorts it based on rank. sort -k6 -n file | awk '$6 != prev { rank = NR }{ print $1, $6, rank ; prev = $6 }' I need the above code to accept variables for the column in the sort statement ("-k6"). Is there a better... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
CSREQ(1)						    BSD General Commands Manual 						  CSREQ(1)

NAME
csreq -- Expert tool for manipulating Code Signing Requirement data SYNOPSIS
csreq [-v] -r requirement-input -t csreq [-v] -r requirement-input -b outputfile DESCRIPTION
The csreq command manipulates Code Signing Requirement data. It reads one requirement from a file or command arguments, converts it into internal form, checks it, and then optionally outputs it in a different form. The options are as follows: -b path Requests that the requirement read be written in binary form to the path given. -r requirement-input Specifies the input requirement. See "specifying requirements" below. This is exactly the same format as is accepted by the -r and -R options of the codesign(1) command. -t Requests that the requirement read be written as text to standard output. -v Increases the verbosity of output. Multiple instances of -v produce increasing levels of commentary output. In the first synopsis form, csreq reads a Code Requirement and writes it to standard output as canonical source text. Note that with text input, this actually compiles the requirement into internal form and then converts it back to text, giving you the system's view of the requirement code. In the second synopsis form, csreq reads a Code Requirement and writes its binary representation to a file. This is the same form produced by the SecRequirementCopyData API, and is readily acceptable as input to Code Signing verification APIs. It can also be used as input to subse- quent invocations of csreq by passing the filename to the -r option. SPECIFYING REQUIREMENTS
The requirement argument (-r) can be given in various forms. A plain text argument is taken to be a path to a file containing the require- ment. This program will accept both binary files containing properly compiled requirements code, and source files that are automatically com- piled for use. An argument of "-" requests that the requirement(s) are read from standard input. Again, standard input can contain either binary form or text. Finally, an argument that begins with an equal sign "=" is taken as a literal requirements source text, and is compiled accordingly for use. EXAMPLES
To compile an explicit requirement program and write its binary form to file "output": csreq -r="identifier com.foo.test" -b output.csreq To display the requirement program embedded at offset 1234 of file "foo": tail -b 1234 foo | csreq -r- -t FILES
DIAGNOSTICS
The csreq program exits 0 on success or 1 on failure. Errors in arguments yield exit code 2. SEE ALSO
codesign(1) HISTORY
The csreq command first appeared in Mac OS 10.5.0 . BSD
June 1, 2006 BSD
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy