3

I have a shell script that checks out a subversion repo. The connection asks for a password (I know it's an unnecessary layer since the password is blank), but how can I send a blank password to subversion?

#!/bin/sh

svn co svn://server/repo ~/Desktop/data

This then sends a password prompt to the terminal, is there a way to automatically respond in my script with a blank password?

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
nullByteMe
  • 6,141
  • 13
  • 62
  • 99
  • @dannrob I read that thread, but they don't address handling a blank password. I tried using empty quotes but that didn't work. I still get prompted when using `--password ""` – nullByteMe Jun 20 '13 at 12:14
  • 1
    Have you tried redirecting a file consisting just of newlines into it? So, create a text file which is just blank lines and then run your command like svn co svn://server/repo ~/Desktop/data < blanklines.txt – matt freake Jun 20 '13 at 12:14

2 Answers2

5

Try specifying password using the following option:

--password ''

nullByteMe
  • 6,141
  • 13
  • 62
  • 99
dannrob
  • 1,061
  • 9
  • 10
  • I lied, this worked. I tried it a long time ago and this did not resolve my issue. I guess maybe I put the switch in the wrong place. Thanks! – nullByteMe Jun 20 '13 at 12:21
1

I really don't recommend doing it like that, but a more generic way would be the use of expect:

How to give password in shell script?

Community
  • 1
  • 1
Rob
  • 11,492
  • 14
  • 59
  • 94