using scp to upload to sourceforge to a path with spaces

The titles says it mostly, if you want to upload a file from a linux machine to the FRS on sourceforge, but you have spaces in your paths:

scp (file_to_upload) (my_user)@frs.sourceforge.net:”/home/frs/project/(project_name)/Path\ with\ spaces/”

Easy, really, if you know all the details to watch out for:

  • enclose the path (everything behind the column) in double quotes (“)
  • Escape each space in that path with a backslash (\)

If you don’t enclose the path with double quotes, you’ll get the following error message :

scp: ambiguous target

The following variables are used in the example:

  • (file_to_upload): the name and path of the file (if you’re not uploading from the folder the file is stored in) of the originating machine
  • (my_user) : your Sourceforge.net username
  • (project_name) : the path for your project. On sourceforge, sometimes you may need to add a few folders in front with the first and the first two letters of your project name : /p/pr/project

Geef een reactie