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

Crashes on start with line 10: $'\r': command not found (User converted files to have Windows newlines and Bash complains) #12

Closed
Ikoth opened this issue Feb 24, 2021 · 1 comment

Comments

@Ikoth
Copy link

Ikoth commented Feb 24, 2021

Hi there,

New install of NetHunter and your script and config files in the downloads folder of a Galaxy S8. Attempting to run any commands results in ten lines of error messages such as:

line 10: $'\r': command not found
line 12: config.default: No such file or directory
line 15: $'\r': command not found
line 16: $'\r': command not found
line 18: $'\r': command not found
line 21: $'\r': command not found
line 29: $'\r': command not found
line 30: $'\r': syntax error near unexpected token '$'{\r''

Any idea what I'm doing wrong please?

error

@urbanadventurer
Copy link
Owner

This error is because the files have had windows newlines included. That is both the 0xa (newline) and 0xd (carriage return).

In this hexdump of the script you can see that the newline is just 0xa (newline). This is how it should be and will work for you.

00000000  23 21 2f 62 69 6e 2f 62  61 73 68 0a 23 20 41 6e  |#!/bin/bash.# An|
00000010  64 72 6f 69 64 2d 50 49  4e 2d 42 72 75 74 65 66  |droid-PIN-Brutef|
00000020  6f 72 63 65 0a 23 20 0a  23 20 55 6e 6c 6f 63 6b  |orce.# .# Unlock|
00000030  20 61 6e 20 41 6e 64 72  6f 69 64 20 70 68 6f 6e  | an Android phon|
00000040  65 20 28 6f 72 20 64 65  76 69 63 65 29 20 62 79  |e (or device) by|
00000050  20 62 72 75 74 65 66 6f  72 63 69 6e 67 20 74 68  | bruteforcing th|
00000060  65 20 6c 6f 63 6b 73 63  72 65 65 6e 20 50 49 4e  |e lockscreen PIN|
00000070  2e 0a 23 20 0a 23 20 54  75 72 6e 20 79 6f 75 72  |..# .# Turn your|

You can use the dos2unix command to fix this issue, or instead copy a fresh copy of the project to your phone.

You can read more about this here, https://stackoverflow.com/questions/11616835/r-command-not-found-bashrc-bash-profile/32912867

@urbanadventurer urbanadventurer changed the title Crashes on start Crashes on start with line 10: $'\r': command not found (User converted files to have Windows newlines and Bash complains) Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants