Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: L A Walsh Newsgroups: gnu.bash.bug Subject: Re: problem with extra space; setting? cygwin only? Date: Tue, 23 Jun 2020 12:31:21 -0700 Lines: 38 Approved: bug-bash@gnu.org Message-ID: References: <20200623192919.GJ19673@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1592940698 13790 209.51.188.17 (23 Jun 2020 19:31:38 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=vJzdPAXKBEuR2oUtN6A45egaldmDmYYL/bXeowVoB/c=; b=HOL1VNd88aKWptCYD+q74/PnNTGTEOE37Q8Xj5ov2qelKlj36j+92u+I+Oxh9uzzeD 52yj6iCDYGh7h+ripP967qcfCNYF5suOwYD9X8sxB95DJjTOzcb0qrs9SctsCHgmue2b Cs6eDXxDPWDhR9mkglKjfrUj/Y78C2LQZs7DnZ/7R6wpVLC9JTHzABJ9fYLZ+KsYGHIS lZnsqC1I3XJH2wvKqcv/P3QT6ymcs7n9b8V3aNOhTdMANAsYleLZqfN5oXVOxGoDGE5Y V1RxTPjidV41rmHD9Z96xEueSvANProji+7NVkG+p9EdxWc2L7r985HPaKYZlrDGfu9x A6+Q== X-Gm-Message-State: AOAM531yIz/Np3KqLj1RnyPxCsW9xj9YuYDPrUBxh3baf0GEVd+5QUbo upKyq2cXwVAsG5JuXSlc3cfhU+XdopKrg1kgizgtCVew5wM= X-Google-Smtp-Source: ABdhPJxBAMniuDtWXrTKBz3UEueO2KtzJKlUZoBaizDEPaeBYhxGIzTkflzfqxRS4K/gLuHOuigjqKp5eL4sMSIg2RQ= X-Received: by 2002:a05:6638:12c7:: with SMTP id v7mr25351140jas.56.1592940695116; Tue, 23 Jun 2020 12:31:35 -0700 (PDT) In-Reply-To: <20200623192919.GJ19673@eeg.ccf.org> Received-SPF: softfail client-ip=209.85.166.53; envelope-from=gsuite@tlinx.org; helo=mail-io1-f53.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 15:21:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=_AUTOLEARN X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <20200623192919.GJ19673@eeg.ccf.org> Xref: csiph.com gnu.bash.bug:16446 there was a linefeed in my source between output="" and the printf. It's a gmail feature to mangle your input. On Tue, Jun 23, 2020 at 12:30 PM Greg Wooledge wrote: > On Tue, Jun 23, 2020 at 12:21:24PM -0700, L A Walsh wrote: > > set output > > output=""printf ${1:+-v $1} "%s:%s" 23 myproc > > -Bash: printf: ` output': not a valid identifier > > Your command is simply wrong. You've got two double-quotes in a row, > which simply cancel each other out, as they contain only the empty > string. So, you are running this: > > output=printf ${1:+-v $1} %s:%s 23 myproc > > Or in other words, create the environment variable 'output' with content > 'printf' in the temporary environment of the command "output", which is > generated by the unquoted parameter expansion between the assignment > and the %s:%s argument. > > Moreover, the error message you show is *not* the one generated by this > command. > > unicorn:~$ set output > unicorn:~$ output=""printf ${1:+-v $1} "%s:%s" 23 myproc > bash: -v: command not found > > The unquoted parameter expansion ${1:+...} expands to the two words > "-v" and "output", so you are attempting to run a command named "-v". > Thus, the error that I showed. > > Either your email does not contain the actual command you're running, > or you've misrepresented the error message it produces. Or both. > >