[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Fwd: Re: basic c thing]



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 <schoepf@informatik.tu-muenchen.de>
To: Phillip Neumann <max@julia.dhis.org>
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 debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org


Reply to: