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

Errors in sourcing when launching a new terminal #79

Open
bkhouri opened this issue Feb 15, 2019 · 2 comments
Open

Errors in sourcing when launching a new terminal #79

bkhouri opened this issue Feb 15, 2019 · 2 comments

Comments

@bkhouri
Copy link

bkhouri commented Feb 15, 2019

I love this idea, and I want to apply on to co-workers. However, when adding source /path/to/evil.sh as the last line in the .bash_profile, error occur when a new terminal is started.

I only tried setting EVIL_BEHAVIOUR to insane or annoying.

On my Mac, running macOS Mojave, I get the following when I start a terminal with EVIL_BEHAVIOUR set to insane

Last login: Fri Feb 15 16:32:16 on ttys009
[1]+  Exit 1                  destructive && sleep $[ ( $RANDOM % 100 ) + 1 ]s && kill -STOP $(ps x -o pid|sed 1d|sort -R|head -1)
bassam.khouri@EMB-7CBUG3QC ~ 
$ 

And I get the following when set to annoying

Last login: Fri Feb 15 16:32:19 on ttys010
usage: basename string [suffix]                                         
       basename [-a] [-s suffix] string [...]
[2]+  Exit 1                  destructive && sleep $[ ( $RANDOM % 100 ) + 1 ]s && kill -STOP $(ps x -o pid|sed 1d|sort -R|head -1)
() bassam.khouri@EMB-7CBUG3QC ~ 
$ 

This error will make it obvious that something is awry in the system.

@bkhouri bkhouri changed the title Errors source when launching a new termina Errors in sourcing when launching a new terminal Feb 15, 2019
@benaryorg
Copy link
Collaborator

Hi,

in case this is still a problem could you post the output of env -i bash -lixc 'source "$1"' -s "${HOME}/.bash_profile", feel free to cut out everything sensitive or irrelevant.

Meanwhile I'll look into it.

@benaryorg
Copy link
Collaborator

I could find the job control output ([n]+ Exit 1 […]), but there does not seem to be anything calling basename in that code, so I need the output of the above command for further analysis.

benaryorg added a commit to benaryorg/evil.sh that referenced this issue Jun 29, 2019
need to start every background job in its own subshell so that we can redirect the job control
output to /dev/null.
Plus a quotation fix there.

Signed-off-by: benaryorg <binary@benary.org>
benaryorg added a commit to benaryorg/evil.sh that referenced this issue Jun 29, 2019
Need to start every background job in its own subshell so that we can redirect the job control
output to /dev/null.
Plus a quotation fix there.

Signed-off-by: benaryorg <binary@benary.org>
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