[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: COMMAND FOR CP
From: |
Eric Blake |
Subject: |
Re: COMMAND FOR CP |
Date: |
Sat, 22 Apr 2006 15:19:39 +0000 |
>
> However, if you are using bash or a similar shell, the
> following construct would do what you desire:
>
> for f in *.GNT; do cp "${f/.GNT}.gnt" ; done
Typo; make that:
for f in *.GNT; do cp "$f" "${f/.GNT}.gnt"; done
Also, you did not mention why you needed to change the
case of the file extensions. On some systems, where the file
system is case-preserving but case-insensitive (such as
Windows or Mac), the above command may not necessarily
work, since such a file system does not allow both
file1.GNT and file1.gnt in the same directory at once. On such
a system, you may need to move the original to a temporary
name, then move it again to the new case spelling
--
Eric Blake