Sponsored Content
Full Discussion: sort find results
Top Forums UNIX for Dummies Questions & Answers sort find results Post 302599414 by shellBeginner75 on Friday 17th of February 2012 07:43:01 AM
Old 02-17-2012
sort find results

Hi,

I have a problem with a shell script.
The script should find all .cpp and .h files and list them.

With:
Code:
 
for file in `find $src -name '*.h' -o -name '*.cpp'

it gives out this:
Code:
 
H:\FileList\A\E\F\G\newCppFile.cpp
H:\FileList\header01.h
H:\FileList\B\nextCppFile.cpp

but i want that it sorts like this:
Code:
 
H:\FileList\header01.h
H:\FileList\A\E\F\G\newCppFile.cpp
H:\FileList\B\nextCppFile.cpp


How is this possible?

---------- Post updated at 07:43 AM ---------- Previous update was at 04:43 AM ----------

Has nobody an idea?

Last edited by shellBeginner75; 02-17-2012 at 08:36 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find results

Hi, how can I get only useful results from find / -size 10000000 without the "Permissions denied" files ? tks C (5 Replies)
Discussion started by: Carmen123
5 Replies

2. UNIX for Dummies Questions & Answers

How to sort find results

Hi-- Ok. I have now found that: find -x -ls will do what I need as far as finding all files on a particular volume. Now I need to sort the results by the file's modification date/time. Is there a way to do that? Also, I notice that for many files, whereas the man for find says ls is... (8 Replies)
Discussion started by: groundlevel
8 Replies

3. Shell Programming and Scripting

HELP: I need to sort a text file in an uncommon manner, can't get desired results

Hi All I have a flat text file. Each line in it contains a "/full path/filename". The last three columns are predictable, but directory depth of each line varies. I want to sort on the last three columns, starting from the last, 2nd last and 3rd last. In that order. The last three columns... (6 Replies)
Discussion started by: JakeKatz
6 Replies

4. Shell Programming and Scripting

Help with sort folder results

Here is the code, but the list is not sorted properly (alphabetically)? <?php function folderlist(){ $startdir = './'; $ignoredDirectory = '.'; $ignoredDirectory = '..'; if (is_dir($startdir)){ if ($dh = opendir($startdir)){ while (($folder = readdir($dh)) !== false){ if... (0 Replies)
Discussion started by: mrlayance
0 Replies

5. UNIX for Dummies Questions & Answers

LINUX SORT command chops results

I am trying to sort a file . The file looks like this: DDFF 2 /ztpfrepos/pgr/load DDFQ 2 /ztpfrepos/pgr/load DDFX 2 /ztpfrepos/pgr/load DDUA 2 /ztpfrepos/pgr/load My command: sort -k1 /home/c153507/Bin/OPL1.txt -o /home/c153507/Bin/OPL1.txt The results are OK except for one line where... (4 Replies)
Discussion started by: Yahalom
4 Replies

6. UNIX for Dummies Questions & Answers

How to do ls -l on results of grep and find?

Hi, Am running the command below to search for files that contains a certain string. grep -il "shutdown" `find . -type f -mtime -1 -print` | grep "^./scripts/active" How do I get it to do a ls -l on the list of files? I tried doing ls -l `grep -il "shutdown" `find . -type f -mtime -1... (5 Replies)
Discussion started by: newbie_01
5 Replies

7. UNIX for Beginners Questions & Answers

Weird 'find' results

Hello and thanks in advance for any help anyone can offer me I'm trying to learn the find command and thought I was understanding it... Apparently I was wrong. I was doing compound searches and I started getting weird results with the -size test. I was trying to do a search on a 1G file owned by... (14 Replies)
Discussion started by: bodisha
14 Replies

8. UNIX for Beginners Questions & Answers

Strange sort -r results

Hi Folks - I have this file that looks like this: outbox/logs/Client_1042.log outbox/logs/Client_941.log outbox/logs/Client_942.log outbox/logs/Client_943.log outbox/logs/Client_944.log And this is my code: #!/bin/bash _OUTBOX_BIN="outbox/logs/" _NAME="Client" _TEMP="temp.txt"... (9 Replies)
Discussion started by: SIMMS7400
9 Replies

9. UNIX for Beginners Questions & Answers

Inconsistent results using sort function

Could you please advise on the following: I have two space-delimited files with 9 and 10 columns, respectively, with exactly the same values in column 1. However, the order of column 1 differs between the two files, so I want to sort both files by column 1, so that I can align them and... (6 Replies)
Discussion started by: aberg
6 Replies

10. UNIX for Beginners Questions & Answers

Strange results from 'strings | sort'

Using the 'strings' command and piping the result to 'sort' is producing strange results. I get block of lines that begin with asterisks, then a block that begins with some text, then more lines that begin with asterisks. The actual content is correct - lines beginning with asterisks is the... (5 Replies)
Discussion started by: edstevens
5 Replies
RTP 
sessions.(3) Library Functions Manual RTP sessions.(3) NAME
RTP sessions. - Classes class TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue > class SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue > This template class adds the threading aspect to the RTPSessionBase template in one of the many possible ways. class RTPSessionBase Generic RTP protocol stack for exchange of realtime data. Typedefs typedef SingleThreadRTPSession RTPSession Uses two pairs of sockets for RTP data and RTCP transmission/reception. typedef RTPSession RTPSocket Alias for RTPSession. typedef SingleThreadRTPSession < SymmetricRTPChannel, SymmetricRTPChannel > SymmetricRTPSession" Uses one pair of sockets, (1) for RTP data and (2) for RTCP transmission/reception. Detailed Description Typedef Documentation RTPSession Uses two pairs of sockets for RTP data and RTCP transmission/reception. UDP/IPv4 RTP Session scheduled by one thread of execution. Examples: audiorx.cpp, audiotx.cpp, ccrtptest.cpp, rtphello.cpp, rtplisten.cpp, and rtpsend.cpp. RTPSocket Alias for RTPSession. SymmetricRTPSession Uses one pair of sockets, (1) for RTP data and (2) for RTCP transmission/reception. Symmetric UDP/IPv4 RTP session scheduled by one thread of execution. Author Generated automatically by Doxygen for ccRTP from the source code. ccRTP Sat Jun 23 2012 RTP sessions.(3)
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy