linux:bash:remove-n-last-char

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:bash:remove-n-last-char [2024/01/02 21:31] – created kbadminlinux:bash:remove-n-last-char [2024/01/02 22:12] (current) kbadmin
Line 1: Line 1:
-====== BASH: Remove last -n Char String / Menghapus -n karakter diakhir ======+====== BASH: Remove last -n Char String / Menghapus -n karakter diakhir dan diawal ======
 Berikut ini adalah cara menghapus last -n karakter dari string Berikut ini adalah cara menghapus last -n karakter dari string
  
 +Menghapus n karakter di akhir
 <code> <code>
 #!/bin/bash #!/bin/bash
Line 12: Line 13:
  
 </code> </code>
 +
 +Menghapus n karakter di awal
 +<code>
 +#!/bin/bash
 +
 +v="some string.rtf"
 +
 +v2=${v:4}
 +
 +echo "$v --> $v2"
 +
 +</code>
 +
  
 Sumber : https://stackoverflow.com/questions/27658675/how-to-remove-last-n-characters-from-a-string-in-bash Sumber : https://stackoverflow.com/questions/27658675/how-to-remove-last-n-characters-from-a-string-in-bash
  

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/remove-n-last-char.1704249093.txt.gz · Last modified: 2024/01/02 21:31 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki