LinuxVillage

Projects and resources (En) => Tips and tricks => Discussion démarrée par: melodie le 03 mai 2015 à 14:00:07

Titre: [bash] expand a command in a shell
Posté par: melodie le 03 mai 2015 à 14:00:07
Reading a doc, seeing "expand the commands", I thought I don't know what "expanding a command" mean, though I probably do it currently without me knowing I do it. A search on the web brought that page which I want to share, as there are commands I never used in it:
http://linuxcommand.org/lc3_lts0080.php

such as:

[me@linuxbox me]$ echo D*
Desktop Documents
[me@linuxbox me]$ echo $(($((5**2)) * 3))
75

or
[me@linuxbox Photos]$ mkdir {2007..2009}-0{1..9} {2007..2009}-{10..12}
Citer
Expansion

Each time you type a command line and press the enter key, bash performs several processes upon the text before it carries out your command. We have seen a couple of cases of how a simple character sequence, for example “*”, can have a lot of meaning to the shell. The process that makes this happen is called expansion.