Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
variable expansion inside string
- X-seq: zsh-users 24113
- From: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: variable expansion inside string
- Date: Tue, 30 Jul 2019 14:28:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jrX8gRo3HyGo+RstJmqmFG9xrKGd46o/hNV3i1lpPIU=; b=F7GYGjUFfAGpvCxLdCV4cEpnIUmueYvmS8s+M7gkfvxsXi1/+iiRN71IS71pyPpjlZ 0xAbztDFKNPx436sNWwtnSfalhK1xYFB4bXj+0GJCoLOWZtnK3u8dYc0Wrbo1GyIb7lo 27zLNgUvurerqdtBZwEcmrJxhQIE9eb1hSdolhfHOLT6V9+5Ru+PHRWirVhPYOaZ+zVu C2eCK1LldHnmRN/jA538rAlpwYFasPAQelBsl2G+nnSRiZIBDbgSpqCTVByQLC090/66 VV1XrCBhHX7w0675Ex//lTvFzvHFoesCAPJlFaMDHiUSbwH99J1wiSwMIxjbqmspugNZ Ayxw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello, is it possibile to do only variable expansion inside a string, eg:
file="filename.txt"
a="*$file*"
I would like to print $a as:
*filename.txt*
I have tried ${(P)a}
and
eval echo -n - $a
but neither do what I would like, because $a does not contains only a
variable name, and the * are expanded by glob subst in the eval case.
thanks in advance
Pier Paolo Grassi
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO
Messages sorted by:
Reverse Date,
Date,
Thread,
Author