bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: maybe a bug in bash?


From: alex xmb ratchev
Subject: Re: maybe a bug in bash?
Date: Sat, 1 Jul 2023 15:52:51 +0200

On Sat, Jul 1, 2023, 15:37 Greg Wooledge <greg@wooledge.org> wrote:

> On Sat, Jul 01, 2023 at 02:45:16PM +0200, alex xmb ratchev wrote:
> > declare -p
> > works well for transmitting bash vars around via ssh
> >
> > ssh foo "$(declare -p vars)
> > more code"
>
> I haven't tested that thoroughly, but it looks OK.  However, it doesn't
> address the problem in this thread, which is that the OP wants to pass
> the "more code" part to ssh on standard input.
>


A combination of your technique with what I wrote yesterday might be
> viable, though.
>
>
> {
>     declare -p password
>     cat <<'EOF'
>     more code
>     which uses "$password"
> EOF
> } | ssh user@host bash


that is then so , code on stdin

That doesn't look too bad.  The "incorrectly indented EOF" can be partly
> solved with <<- if one uses literal tabs on the EOF line.  Not all text
> editors (or text editor configurations) like to do that, though.
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]