Or you could try "man rename.2".  rename is a stdio function.  You
should also look at opendir, readdir and closedir.  
-------- Original Message --------
Subject: Re: basic c thing
Resent-Date: 26 Sep 1999 10:22:49 -0000
Resent-From: debian-devel@lists.debian.org
Resent-CC: recipient list not shown: ;
Date: Sun, 26 Sep 1999 11:21:06 +0200 (CEST)
From: Thomas Schoepf <[EMAIL PROTECTED]>
To: Phillip Neumann <[EMAIL PROTECTED]>
CC: debian-devel@lists.debian.org

On Fri, 24 Sep 1999, Phillip Neumann wrote:

> Im just beginning to mess my hands into c, so i need some tips...
> i want to make a program that will rename all dirs in the current dir 
> position to "<dir-name>-renamed". rename files instead of dirs would help me 
> a lot too...

Is this everything you want? Then why torture your brain with c? This is
what I would try:

#!/bin/sh
for i in *; do
        if [ -d $i ]; then
                mv $i $i.renamed
        fi
done


-- Thomas
PGP public key available (KeyID 2EA7BBBD) | Echelon is watching you.
http://www.in.tum.de/~schoepf/pgpkey.txt  |


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]

Reply via email to