korn script

Need help with C, C++, perl, python, etc?

korn script

Postby anarki » 2007-02-07 10:08

Does anybody know how can i refine a search in a directory like this




drwxrwx--- 4 100048 100000 1024 Feb 07 08:53 xxxxx1
drwxrwx--- 2 uid25083 uid25083 2048 Feb 02 09:59 xxxxx2
drwxrwx--- 3 100056 100000 1024 Feb 06 17:06 xxxxx3
drwxrwx--- 2 40470 32768 80 Sep 06 14:36 xxxxx4
drwxrwx--- 2 100042 100000 1024 Feb 07 08:53 xxxxx5
drwxrwx--- 3 10035 100000 2048 Feb 05 11:22 xxxxx6
.
.
.

so that i can take every directory which belong to an UID of 5 digit and rename it

Thanx
anarki
 
Posts: 19
Joined: 2006-03-22 13:27

Postby Grifter » 2007-02-09 15:22

pardon, i don't know anything about korn, but going from a bash perspective, can't you just do a loop with a find directory, set a variable to check each loop iteration with an awk to get the uid field, piped to sed with a regexp to go off at 5 characters, and then if the variable is non-empty, rename the loop variable to the new dirname

and if this doesn't work with korn, sorry, just ignore the post (:
Eagles may soar, but weasels don't get sucked into jet engines...
Grifter
 
Posts: 1572
Joined: 2006-05-04 07:53
Location: Svea Rike


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable