Usuwanie spacji z zmiennych w bash

Usuwanie początkowych / „wiodących” spacji z zmiennej:

ZMIENNA="${ZMIENNA#"${ZMIENNA%%[![:space:]]*}"}"

Usuwanie końcowych / „wleczących” spacji z zmiennej:

ZMIENNA="${ZMIENNA%"${ZMIENNA##*[![:space:]]}"}"
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Display basic information about Physical Volumes
Viewed 3578 times since Sun, Jun 3, 2018
Utilities to Tidy Up Your Reports
Viewed 16388 times since Wed, May 30, 2018
10 Awk Tips, Tricks and Pitfalls
Viewed 6096 times since Wed, Aug 19, 2020
10 Xargs Command Examples in Linux / UNIX
Viewed 4119 times since Fri, Jun 1, 2018
Bash: Read File Line By Line – While Read Line Loop
Viewed 2378 times since Mon, Feb 18, 2019
awk printf
Viewed 15519 times since Wed, Aug 19, 2020
Linux: Repeat Command N Times – Bash FOR Loop
Viewed 3171 times since Mon, Feb 18, 2019
Bash: String Length – How To Find Out
Viewed 2329 times since Mon, Feb 18, 2019
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 5920 times since Sun, Jan 9, 2022
Script HW/SW AIX
Viewed 9383 times since Mon, Jun 4, 2018