Skip to content

Shift $1 out prior to eval - #100

Open
zavorka wants to merge 1 commit into
edc:masterfrom
reBass:shift-$1-out
Open

zavorka wants to merge 1 commit into
edc:masterfrom
reBass:shift-$1-out

Conversation

@zavorka

@zavorka zavorka commented Jul 14, 2021

Copy link
Copy Markdown
Contributor

Shift the first positional parameter out into a variable before running the eval command, so that it is not passed onto sourced scripts.

Fixes #89

Shift the first positional parameter out into a variable before running
the eval command, so that it is not passed onto sourced scripts.
@edc

edc commented Jul 19, 2021

Copy link
Copy Markdown
Owner

Sorry about the late response. Could you please add a quick test? Thanks!

@edc edc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's much clearer if we just update L66 to replace bass with $1. WDYT?

@skycaptain

Copy link
Copy Markdown

@zavorka @edc anything we could to to push things forward?

@JDuchniewicz

Copy link
Copy Markdown

Is it possible to merge this any time forthcoming?

@yoeluk

yoeluk commented Jun 16, 2022

Copy link
Copy Markdown

this seems left behind but it is still very frustrating behaviour... I think that the change requested by @edc is essentially this command = 'shift; eval $1 && ({}; alias) >&{}'.format(. If this is correct, can we satisfy this @zavorka ?

mattbailey pushed a commit to mattbailey/bass that referenced this pull request Nov 22, 2023
LiamClarkeNZ added a commit to LiamClarkeNZ/bass2 that referenced this pull request Mar 26, 2026
Capture "$@" into a variable and clear positional parameters with
shift before eval, so scripts sourced via bass no longer see the
command args as $1/$2/etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

$1 is set in contrast to bash

5 participants