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:33:23 -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 1592940822 13872 209.51.188.17 (23 Jun 2020 19:33:42 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=jTJknrYIa9hs89rwLIZKOtiH8e2nvFvIT6O/AYWOjUM=; b=OWw9PCPIiQFf5WwVkVlRoOGOiaUjgngmjsbI34elIYG/+dmw4ZWV7/70upjat9vvFK MNCEm9pzOfL+y8Uoc+5Pzdo1FZBmQvra9vtYq8x5D/wv4hFV5zCvLnmmYIHFlgEd3Lj5 +wcaYo9LI3bk1MPu75GhBTnF6waZC6xhe96oryoZLoA1AYtqHtqO/DAaYYLwBLkgbbDm 3klura7rw0qYhplwr6qRfpAxFZYnA/JUrZKbZmX38VxlsVO0+POKQ042VVvQ8jsgthbT Ir65yQQF7eIKx4mpl7+lDo5dNS3eUuCXnuF3SDEKq8LEFYaurfF7IuEEgWfljh53XJup QN1Q== X-Gm-Message-State: AOAM5314Db7nRGoQMiIj9FYci0YSpAVUuTqBiOStHfCdSnUZv6tUxgwZ ervLqfucWdALcpJlGHTtYVTAP47hXz/6UedxpnLdx11xzRQ= X-Google-Smtp-Source: ABdhPJxTe4w5l69yRXLIMerEomxd1JBgI0KFoKT1WTBaRvOO7ZZFG8J7uZdDaM2lQKVcnFfL9kMaA1fyRDcJDSrFKnU= X-Received: by 2002:a05:6638:1409:: with SMTP id k9mr26323822jad.125.1592940817295; Tue, 23 Jun 2020 12:33:37 -0700 (PDT) In-Reply-To: <20200623192919.GJ19673@eeg.ccf.org> Received-SPF: softfail client-ip=209.85.166.49; envelope-from=gsuite@tlinx.org; helo=mail-io1-f49.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 15:33:37 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:16447 It's a gmail feature to mangle your input in weird ways when you cut/paste. the line with 'output=""' is separate from the "printf" line. Sorry. 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. > >