Expansão de parâmetros no bash
Pegar parâmetro usando $1 $2 e $3 é fácil né?
Todo mundo já sabe!
E se você quiser pegar apenas os parâmetros do 3 pra frente?
${*:3}
Loko.
:)
refs
3.4.2 Special Parameters
The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.
*
($*) Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and filename expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS special variable. That is, "$*" is equivalent to "$1c$2c…", where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are separated by spaces. If IFS is null, the parameters are joined without intervening separators.
:* (!)
Gostou do conteúdo?
Você também me encontra nessas redes!
Mastodon
PixelFed
Lemmy
WriteFreely
@gutocarvalho@bolha.blog @notamental@bolha.blog @poesias@bolha.blog @contos@bolha.blog
Bookwyrm
Peertube
Funkwhale
Friendica
Quer saber mais sobre mim?
Visite meus sites!
Conhece o Coletivo Bolha?
Então vem conhecer o bolha.io!
- fediverso
- mastodon, https://bolha.us
- pixelfed, https://bolha.photos
- lemmy, https://bolha.forum
- bookwyrnm, https://bolha.review
- writefreely, https://bolha.blog
- peertube, https://bolha.tube
- castopod, https://bolha.studio
- owncast, https://bolha.stream
- friendica, https://bolha.network
- gacio, https://bolha.events
- chat
- mattermost, https://mattermost.bolha.chat
- video
- jitsi, https://bolha.video
- jitsi, https://bolha.video
- agenda
- calcom, https://bolha.in
- frontends
- lingva, https://translate.bolha.tools
- libremdb, https://libremdb.bolha.tools
- translations
- libretranslate, https://libretranslate.bolha.tools
- editors
- hedgedoc, https://notes.bolha.tools
- draw.io, https://draw.bolha.tools
- excalidraw, https://excalidraw.bolha.tools
- pdf stirling, https://spdf.bolha.tools
- wisemaping, https://mindmap.bolha.tools
- mermaid, https://mermaid.bolha.tools
- cryptpad, https://cryptad.bolha.tools
- secrets sharing
- yopass, https://yopass.bolha.tools
- password pusher, https://pusher.bolha.tools
- pastbin
- yabin, https://yabin.bolha.tools
- terminal recorder
- ascinnema, https://ascinemma.bolha.tools
- anti paywall
- 13ft, https://open.bolha.tools
Nós temos muito mais para compartilhar contigo!
Conhece o HackSpace da Bolha?
Vem conhecer o espaço que usamos para estudar o fediverso!
Nosso site
WriteFreely
Quer apoiar nosso trabalho? Você pode!
- https://www.patreon.com/bolha
- https://apoia.se/bolha
- pix@bolha.us
Te vejo no mastodon da bolha.us!
[s]