0

I'm building rpm with maven on cygwin64 but I have a problem, the rpm file's separator are backward slash (Windows Style) so I need to be forward slash(/) because I need to deploy on Linux.

Any help?

Rafael Reyes
  • 2,615
  • 8
  • 34
  • 51

1 Answers1

1

You never showed us the commands you are running, so this answer is therefore untested for your use case. However, a quick search through Stack Overflow revealed this great answer, which has a solution for dealing with backslashes in Cygwin. One can place a path containing backslashes in single quotes and this makes it work. The single quotes allows Cygwin to not treat the backslashes as forming escape characters.

As an example, if you had the following command which does not work:

cd home\rafael\docs

you could place the path in single quotes to make it work:

cd 'home\rafael\docs'

and of course this would also work with forward slashes:

cd home/rafael/docs
Community
  • 1
  • 1
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • Don't refer this question to another one if you can avoid that. Are you trying to write a _Linux_ bash script or a _Windows_ script? – Tim Biegeleisen May 13 '16 at 14:52
  • I'm trying to write a Windowsscript – Rafael Reyes May 13 '16 at 14:58
  • How can you deploy a Windows script on a Linux system? Can you clarify what you really are trying to do here? – Tim Biegeleisen May 13 '16 at 14:59
  • I followed this post http://zcourts.com/2012/09/11/building-rpms-on-windows/#sthash.6lwkcsTW.RRzmjIW4.dpbs that explains how to build an RPM on Windows with CygWin and also provides a Windows script that : "script replaces backslashes in the spec file generated with Windows paths. It then executes the "real rpmbuild" using Cygwin's bash (to provide a linuxish environment)" but the script displays an error , so I'm wondeing if there is possible to Build rpm on windows with forward slash / – Rafael Reyes May 13 '16 at 15:03
  • Modify the script and replace the backslashes. – Tim Biegeleisen May 14 '16 at 00:57