Coder Social home page Coder Social logo

Comments (7)

mrrfv avatar mrrfv commented on July 19, 2024

I'm still on vacation, so my ability to help is very limited atm. Could you try changing #!/bin/bash to #!/bin/zsh in backup.sh and see if anything changes? IIRC zsh is the default shell in macOS, so it should be more up to date.

from open-android-backup.

panomitrius avatar panomitrius commented on July 19, 2024

Getting similar errors..
Tried both with #!/bin/bash and #!/bin/zsh

When I run the script I get all this without typing anything:

bash ./backup.sh
./backup.sh: line 29: [: -v: unary operator expected
Please enable developer options on your device, connect it to your computer and set it to file transfer mode. Then, press Enter to continue.
./backup.sh: line 20: [: -v: unary operator expected
./backup.sh: line 29: [: -v: unary operator expected
If you have connected your device correctly, you should now see a message asking for access to your phone. Allow it, then press Enter to go to the last step.
./backup.sh: line 29: [: -v: unary operator expected
Tip: If this is not the first time you're using this script, you might not need to allow anything.
./backup.sh: line 20: [: -v: unary operator expected
List of devices attached
RF8MC0XCSQN	device

./backup.sh: line 29: [: -v: unary operator expected
Can you see your device in the list above, and does it say 'device' next to it? If not, quit this script (ctrl+c) and try again.
./backup.sh: line 84: [: -v: unary operator expected
./backup.sh: line 109: [: -v: unary operator expected
./backup.sh: line 118: [: -v: unary operator expected
./backup.sh: line 29: [: -v: unary operator expected
Linux Android Backup will install a companion app on your device, which will allow for contacts to be backed up and restored.
./backup.sh: line 29: [: -v: unary operator expected
The companion app is open-source, and you can see what it's doing under the hood on GitHub.
./backup.sh: line 29: [: -v: unary operator expected
Companion app already downloaded.
./backup.sh: line 29: [: -v: unary operator expected
Attempting to uninstall companion app.
./backup.sh: line 29: [: -v: unary operator expected
Installing companion app.
Performing Streamed Install
Success
./backup.sh: line 29: [: -v: unary operator expected
Granting required permissions to companion app.
./backup.sh: line 29: [: -v: unary operator expected
Cleaning up after previous backup/restore...
backup-tmp
./backup.sh: line 155: [: =: unary operator expected
./backup.sh: line 217: [: =: unary operator expected
./backup.sh: line 29: [: -v: unary operator expected
If this project helped you, please star the GitHub repository. It lets me know that there are people using this script and I should continue working on it.

Using MacOS 10.15.7 and

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

zsh 5.7.1 (x86_64-apple-darwin19.0)

Regards!

from open-android-backup.

mrrfv avatar mrrfv commented on July 19, 2024

Try running the script directly with zsh, i.e. zsh ./backup.sh - the first line in the log you posted shows that the script is being interpreted by bash.

from open-android-backup.

thetuxinator avatar thetuxinator commented on July 19, 2024

If you add #!/bin/zsh to the script and run it using bash ./backup.sh the script is again run by bash, adding the shebang only has an effect if you make the actual script (.sh file) executable and run ./backup.sh without any shell in prefix.

from open-android-backup.

giri256 avatar giri256 commented on July 19, 2024

Can confirm. NOT WORKING on big sur 11.7, same thing as above, companion app won't open in phone and script exits

from open-android-backup.

mrrfv avatar mrrfv commented on July 19, 2024

@kissge @thetuxinator @giri256 Could you try following the guide below and running the script with bash again? I feel like this error is definitely caused by Apple shipping an outdated version of Bash with macOS.

https://www.shell-tips.com/mac/upgrade-bash/

from open-android-backup.

mrrfv avatar mrrfv commented on July 19, 2024

Reproduced on macOS 13 - you simply need to update bash with Homebrew to fix: brew install bash. I just updated the installation/usage instructions to make the script compatible with Macs. Thanks for reporting!

from open-android-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.