Sorting Windows Directories using Korn script.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sorting Windows Directories using Korn script.
# 1  
Old 10-30-2008
Sorting Windows Directories using Korn script.

I have a directory called test, which contains multiple sub directories namely TF80A, TF80B, TF80C.

I need to sort these directories by name, so in the above case TF80A Is the oldest and TF80C is the latest.

Is there a ksh script that would loop through the directories and sort these directories from the earliest to the latest. Again I dont need to sort it by the date these sub directories where created or modified, and rather by their names -. Thanks
# 2  
Old 10-30-2008
Question

ls -l
would normally list files in name order, with lots of details on each entry

ls -l | grep "^d"
would then just provide those that are directory

Is this what you are tryign to do?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pass script with parameter in korn shell script

I have written a script which will take input parameter as another script. However, if the script passed as input parameter has parameters then this script doesn't work. I have a script b.ksh which has 1 and 2 as parameters I have a script c.ksh which has 3,4 and 5 as parameters vi a.ksh... (1 Reply)
Discussion started by: Vee
1 Replies

2. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

3. Shell Programming and Scripting

HELP on Perl array / sorting - trying to convert Korn Shell Script to Perl

Hi all, Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM. Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers. At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies

4. Shell Programming and Scripting

Need help in listing directories inside korn shell script

Hi All, I need to loop through each item in current path, if it is a direcotry do soemthing, if its a file jsut skip it and move to next item in loop. Tried if test ! -d $i then echo "The current item $i is not a directory" continue fi This doesnt seems to be working .... (8 Replies)
Discussion started by: justchill
8 Replies

5. Shell Programming and Scripting

MKS KORN SHELL WONT EXECUTE from windows command prompt

Can anybody help me with this small script , the script works fine and launches the IE from c:\documents and settings \test\my documents>ksh prompt $RunURL1.sh this scitpt works and launches the ie from ksh , but when i schedule it to run the script then i get the error box saying command:1... (2 Replies)
Discussion started by: venu
2 Replies

6. UNIX for Dummies Questions & Answers

Sorting files in different directories

hi everybody, first time writing. Here's my question: I've got several files in different directories like this: aa/t1 aa/bb/t2 aa/t2 aa/bb/cc/t1 aa/t3 and would like to get this sorting: aa/t1 aa/bb/cc/t1 aa/t2 aa/bb/t2 aa/t3 (1 Reply)
Discussion started by: Camisa
1 Replies

7. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

8. Shell Programming and Scripting

map windows directories to unix

How to map the windows directories to unix filepath using perl scripts? (0 Replies)
Discussion started by: vinay123
0 Replies

9. UNIX for Dummies Questions & Answers

getting list of directories on windows using ftp

is this possible ? i want to get the complete path of current working directory and folders under that directory ( ignore the files in them ) on windows usingn ftp from a unix box The reason i am asking is because I need to write a script so that whenever a user creates a folder on windows... (0 Replies)
Discussion started by: systemsb
0 Replies

10. What is on Your Mind?

Windows and the Korn shell

I just found this story about how microsoft tried to integrate Unix like shell scripting in NT. It dates back 1997 but it is still funny: And David Korn version of it: http://slashdot.org/articles/01/02/06/2030205.shtml (0 Replies)
Discussion started by: ripat
0 Replies
Login or Register to Ask a Question