Agnello George
2011-Jan-24 11:57 UTC
[CentOS] unable to check in code to svn when files contain spaces or characters
i got a file like this and i need add it into my svn admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls i as able to add other files with space using the following command : svn st |grep ? |cut -c8- |sed 's/ /\\ /g' |xargs svn add however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file . can some one help me in this in perl or in shell . -- Regards Agnello D'souza -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20110124/097baf20/attachment-0002.html>
Nico Kadel-Garcia
2011-Jan-24 12:55 UTC
[CentOS] unable to check in code to svn when files contain spaces or characters
On Mon, Jan 24, 2011 at 6:57 AM, Agnello George <agnello.dsouza at gmail.com> wrote:> i got a file like this and i need add it into my svn > > admin/upload_data/FINAL? leg? list? 19_01_2010 to? agar? (Merged data in > one).xlsFirst: don't do this, seriously. You're begging for pain in your scripting to handle such files from now on.> i as able to add other files with space using the following command : > > ?svn st |grep ? |cut -c8- |sed 's/ /\\ /g' |xargs svn addSecond, stop playing with xargs in command line handling. It is not your friend. You should be able to do "svn add "admin/upload_data/FINAL leg list svn add "admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls"> however there are some special characters like ( ) +#@? that svn cannot > understand as the full path of? the file .Well, *YES*. You're going to have difficulty getting characters that mean things to the subversion somponent numbering scheme or the Subversion URL scheme, such as '@', '/', and '#' into the actual filenames. Even if you can leverage your way past this by stuffing in enough backslashes, you're effectively destabilizing your Subversion repository and scripting to handle it, especially post-commit scripts.> can some one help me in this in perl or in shell . > > -- > Regards > Agnello D'souzaCan you first explain why you want, or need, to do this?
Les Mikesell
2011-Jan-24 13:42 UTC
[CentOS] unable to check in code to svn when files contain spaces or characters
On 1/24/11 5:57 AM, Agnello George wrote:> i got a file like this and i need add it into my svn > > admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls > > i as able to add other files with space using the following command : > > svn st |grep ? |cut -c8- |sed 's/ /\\ /g' |xargs svn add > > however there are some special characters like ( ) +#@ that svn cannot > understand as the full path of the file . > > can some one help me in this in perl or in shell .What you need to know is too long to describe here, but first you need to find a list of shell metacharacters and how to quote them on the command line. Short version is that a \ quotes the next character single quotes quote everything except another single quote literally, double quotes cover most things but allow $variable expansion. Then you need to look at what subversion itself requires after you get the literal value past the shell parser. I thought it was just that @ was interpreted as file at revision peg revision unless you append another @ to the end but there could be more restrictions. All of that is simple enough to work around - but probably not worth it compared to using sensible names. However the thing that is going to kill you is that files that differ only in case of one or more letters are different files on linux - and in a linux svn repository - but not on windows (where such things are most likely being created). Enforce some rules before that happens. -- Les Mikesell lesmikesell at gmail.com
Apparently Analagous Threads
- difference between stickybit SUID and SGID
- installing windows 2008 server( VM) on a centos xen server
- Substituting in a variable file name in a Windows system command
- how to ensure systems users strong passwdors enabled
- how to access external USB drive in single user mode