简体   繁体   中英

How to use expect to bypass the initial `Press return to continue.` question of unison?

I'd like to bypass the Press return to continue. question of unison (This happens when the sync is an intial sync. If it is not the first time, then this question does not appear and expect should be able to know this and do nothing). When this question appears, space should be typed by expect to let unison move on.

But I still want to be able to make selections for the sebsequent questions.

Does anybody know how to achieve this goal with expect ? Thanks.

$ unison -root o1 -root o2
Unison 2.51.2 (ocaml 4.08.1): Contacting server...
Looking for changes
Warning: No archive files were found for these roots, whose canonical names are:
    /private/tmp/o1
    /private/tmp/o2
This can happen either
because this is the first time you have synchronized these roots, 
or because you have upgraded Unison to a new version with a different
archive format.  

Update detection may take a while on this run if the replicas are 
large.

Unison will assume that the 'last synchronized state' of both replicas
was completely empty.  This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.

If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.

Donations to the Unison project are gratefully accepted: 
http://www.cis.upenn.edu/~bcpierce/unison

Press return to continue.[<spc>]  Reconciling changes

o1             o2                 
file     ---->            x.txt  [f] f

Proceed with propagating updates? [] y

See unison -help

Basic options:
-auto              automatically accept default (nonconflicting) actions
-batch             batch mode: ask no questions at all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM