# SED + addition calculation before substitution

**URL:** <https://www.debian-fr.org/t/sed-addition-calculation-before-substitution/87174>\
**Category:** Programmation\
**Created:** [Septembre 23, 2022, 3:09 UTC](https://www.debian-fr.org/t/sed-addition-calculation-before-substitution/87174 "2022-09-23T15:09:28Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![anon36725218](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/a/8e8cbc/32.png) [@anon36725218](https://www.debian-fr.org/u/anon36725218)\
**Post date:** [Septembre 26, 2022, 3:46 UTC](https://www.debian-fr.org/t/sed-addition-calculation-before-substitution/87174/25 "2022-09-26T15:46:39Z")

</div>

> [@anon29980398](#):
>
> ```auto
> michel@deb114x:~$ val=20210923000001
> michel@deb114x:~$ echo ${val:8}
> 000001
> michel@deb114x:~$
> 
> ```

Tiens, tu m’as bien dis que c’était en BASH petit·e malin·e 🙂

Je fais un script `.sh` que je suis entrain d’écrire - je le met [ici](https://www.debian-fr.org/t/dane-dnssec-signatures-valid-or-not-valid/86932/8) tiens 😌.

Par exemple :

```
#!/bin/sh
SOA="20210923000001" | egrep -ho '[0-9]{8,}')
SERIAL_SOA="$(echo ${SOA:8})"

```

Me retourne une erreur sur les deux-points `:` de la variable → `${SOA:8}` 🙂

Je cherche… heu.. je sors 😅 avant que le bureau de «&nbsp;tabac&nbsp;» ferme 🙂 vive la montagne.

---

_[View the full topic](https://www.debian-fr.org/t/sed-addition-calculation-before-substitution/87174)._
