How to trim space from bash variable

Posted In Shell - By Tum. On Thursday, February 20th, 2014 With 0 Comments

bashTip เล็กๆ ในการลบ space (ช่องว่าง) ที่อยู่ในตัวแปรของ bash shell

ต้องการลบ space ด้านหลัง ให้ใช้

ตัวอย่าง


ผลลัพธ์

ต้องการลบ space ด้านหน้า ให้ใช้

ตัวอย่าง

ผลลัพธ์

ต้องการลบ space ทั้งด้านหน้า และหลัง ให้ใช้

ตัวอย่าง

ผลลัพธ์

คำค้นยอดนิยม: bash trim spaces

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*