0

I am trying to capitalize all files in my current working directory using the following command:

ls | awk '{system("svn mv " $0 " " toupper(substr($0,1,1)) substr($0,2))}'

Yet, I am getting the following error message:

svn: '.' is not a working copy
svn: '.' is not a working copy
svn: '.' is not a working copy
svn: '.' is not a working copy

I am on a osx. Could you please help? Thanks in advance.

Chris Page
  • 18,263
  • 4
  • 39
  • 47
Tom
  • 305
  • 2
  • 4
  • 15
  • Have you tried doing one of those `svn` commands manually to see whether it works? Does `svn info` work in that directory? – Chris Page Jul 13 '12 at 23:16

1 Answers1

0

you should not use ls in scripting, ls is for human presentation of data (and will surprise your scripts with space in names, special folders like . and .. like here and so on...), try instead:

for f in *;do;svn mv $f $(echo $f| tr '[a-z]' '[A-Z]');done

See here for other case conversions alternatives, I used tr since awk is not needed here.

Community
  • 1
  • 1
jolivier
  • 7,380
  • 3
  • 29
  • 47