Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script seems to need bash #680

Closed
2 tasks done
tvandera opened this issue Jul 26, 2021 · 6 comments
Closed
2 tasks done

Install script seems to need bash #680

tvandera opened this issue Jul 26, 2021 · 6 comments

Comments

@tvandera
Copy link

  • [] Did you use the latest version of GEF from dev branch?
  • [n/a ] Is your bug specific to GEF (not GDB)? - Try to reproduce it running gdb -nx
  • Did you read the documentation first?
  • Did you check issues (including
    the closed ones) - and the PR?

Step 1: Describe your environment

  • Operating System / Distribution: Ubuntu 20.04
  • Architecture: x86 64bit
  • GEF version:
GEF: (Standalone)
SHA1(/home/vanderaa/.gef-e95b072f5684857ffd3d3c95c3369f83cdba0dee.py): 743f638904c44c815ed815b7530c0d07069e775e
GDB: 9.2
GDB-Python: 3.8

Step 2: Describe your problem

Steps to reproduce

Install command fails with sh:

$ wget -q -O- https://github.com/hugsy/gef/raw/master/scripts/gef.sh | sh
sh: 6: test: unexpected operator

Works with bash:

$ wget -q -O- https://github.com/hugsy/gef/raw/master/scripts/gef.sh | bash

/bin/sh is dash on Ubuntu:

$ dpkg -S /bin/sh
diversion by dash from: /bin/sh
diversion by dash to: /bin/sh.distrib
dash: /bin/sh
$ dpkg -s dash | grep Version
Version: 0.5.10.2-6

When adding set -x around line 6:

$ sh gef.sh
+ test  == dev
gef.sh: 7: test: unexpected operator
+ set +x
@Grazfather
Copy link
Collaborator

Where are you seeing instructions that say to use sh?

# via the install script
## using curl
$ bash -c "$(curl -fsSL http:https://gef.blah.cat/sh)"

## using wget
$ bash -c "$(wget http:https://gef.blah.cat/sh -O -)"

# or manually
$ wget -O ~/.gdbinit-gef.py -q http:https://gef.blah.cat/py
$ echo source ~/.gdbinit-gef.py >> ~/.gdbinit

# or alternatively from inside gdb directly
$ gdb -q
(gdb) pi import urllib.request as u, tempfile as t; g=t.NamedTemporaryFile(suffix='-gef.py'); open(g.name, 'wb+').write(u.urlopen('https://tinyurl.com/gef-master').read()); gdb.execute('source %s' % g.name)

@tvandera
Copy link
Author

@Grazfather
Copy link
Collaborator

Thanks

@Grazfather
Copy link
Collaborator

Fixed via 0b6d816

@tvandera
Copy link
Author

hugsy pushed a commit that referenced this issue Jul 26, 2021
@Grazfather
Copy link
Collaborator

48a9fd7. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants