linux:bash:remove-n-last-char
Differences
This shows you the differences between two versions of the page.
linux:bash:remove-n-last-char [2024/01/02 21:31] – created kbadmin | linux: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 |
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 | ||
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 12: | Line 13: | ||
</ | </ | ||
+ | |||
+ | Menghapus n karakter di awal | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | v=" | ||
+ | |||
+ | v2=${v:4} | ||
+ | |||
+ | echo "$v --> $v2" | ||
+ | |||
+ | </ | ||
+ | |||
Sumber : https:// | Sumber : https:// | ||
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