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 does not work #1

Open
perryprog opened this issue Dec 25, 2016 · 7 comments
Open

Install script does not work #1

perryprog opened this issue Dec 25, 2016 · 7 comments

Comments

@perryprog
Copy link

Running ./install produces sed: 1: "$HOME/.zshrc": extra characters at the end of p command

Using ZSH, steps to recreate:

  • run zsh && cd $HOME && git clone https://github.com/shivrai/cpm.git
  • run cpm/install

You should get the error sed: 1: "$HOME/.zshrc": extra characters at the end of p command.

@shivansh
Copy link
Owner

shivansh commented Dec 26, 2016

Thanks for reporting.
Which OS and sed version are you using ? My guess is that you are on either OS X or other BSD derivative. If this is the case then I have tried to fix this behavior in this commit. Try rebasing from current HEAD and see if it solves the issue.

@perryprog
Copy link
Author

Cool, I'm on macOS.

@perryprog
Copy link
Author

Fixed.

@perryprog
Copy link
Author

Not sure if I should open a new issue for this, but when executing cow_selector there are two errors.

  1. There is no -c argument to fortune
  2. something weird is going on with line 28: cookie_arr[$i]="$cookie"

I'm running the latest homebrew version of bash and fortune

@perryprog perryprog reopened this Dec 26, 2016
@shivansh
Copy link
Owner

  1. There is no -c argument to fortune

Quoting from man pages,
-c Show the cookie file from which the fortune came.
I guess that fortune on OS X has an alternative implementation of -c option. Can you please paste here the fortune version you are using.

  1. something weird is going on with line 28: cookie_arr[$i]="$cookie"

It would be helpful if you could paste the entire error log.

I'll try to fix these issues, although I don't have any way of testing these yet since I run Linux (I can of course set up a VM but that will have to wait for the next 3-4 days). If you think that you can find out where the problem is, I'd say a fix is more than welcome 😃

@perryprog
Copy link
Author

perryprog commented Dec 26, 2016

Fortune crash log:

fortune: illegal option -- c
fortune-mod version 9708
fortune [-afilosw] [-m pattern] [-n number] [ [#%] file/directory/all]

And weird line 28 crash:
/Users/perry/cpm/cow_selector:28: cookie_arr: assignment to invalid subscript range

I'm gonna guess it's just my system. Not sure, but if you have docker there might be a BSD container.

EDIT: Version of bash is 3.2.57(1)-release (x86_64-apple-darwin16) and version of fortune is 9708

@perryprog
Copy link
Author

Update: as far as I can tell, there is no -c option or any other way to achieve the same output. I'm not big in shell programming, so I still have no idea about line 28.

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