Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Lack of skill dictates economy of style. -- Joey Ramone


devel / comp.unix.shell / eval some complicated commands directly.

SubjectAuthor
o eval some complicated commands directly.hongy...@gmail.com

1
eval some complicated commands directly.

<a101ca81-0f9d-43bd-b750-8448693ef84bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4989&group=comp.unix.shell#4989

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:59c7:0:b0:2de:7469:8185 with SMTP id f7-20020ac859c7000000b002de74698185mr10784741qtf.287.1645889587724;
Sat, 26 Feb 2022 07:33:07 -0800 (PST)
X-Received: by 2002:a05:6214:c2b:b0:432:5ec4:9304 with SMTP id
a11-20020a0562140c2b00b004325ec49304mr9390472qvd.22.1645889587507; Sat, 26
Feb 2022 07:33:07 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!5.161.45.24.MISMATCH!2.us.feeder.erje.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Sat, 26 Feb 2022 07:33:07 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=203.175.13.138; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 203.175.13.138
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a101ca81-0f9d-43bd-b750-8448693ef84bn@googlegroups.com>
Subject: eval some complicated commands directly.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Sat, 26 Feb 2022 15:33:07 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 50
 by: hongy...@gmail.com - Sat, 26 Feb 2022 15:33 UTC

I use pyenv [1] on Ubuntu 20.04.3 LTS, which needs the following configuration in ~/.bashrc:

```
eval "$(pyenv init -)"
```

The `pyenv init -` called above will be expanded into the following when evaluated:

```
$ pyenv init -
export PYENV_SHELL=bash
source '/home/werner/Public/repo/github.com/pyenv/pyenv.git/libexec/../completions/pyenv.bash'
command pyenv rehash 2>/dev/null
pyenv() {
local command
command="${1:-}"
if [ "$#" -gt 0 ]; then
shift
fi

case "$command" in
activate|deactivate|rehash|shell)
eval "$(pyenv "sh-$command" "$@")"
;;
*)
command pyenv "$command" "$@"
;;
esac
} ```

Now, I want to eval of slightly revised version of the above `pyenv init -`, which means that I must eval these complicated commands directly. I tried with the following method:

```
eval "$(
# Here comes the revised version of the above `pyenv init -`
....
)"
```

But it seems this method doesn't work, especially, the following line in the original version of `pyenv init -`, which adds the bash completion for pyenv doesn't work in my revised one:

source '/home/werner/Public/repo/github.com/pyenv/pyenv.git/libexec/../completions/pyenv.bash'

Any hints to make a completely equivalently eval with these complicated commands directly?

[1] https://github.com/pyenv/pyenv

Regards,
HZ

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor