# pkg install and  * (regex)



## any_name_you_wish (Dec 18, 2021)

Hello, 

wouldn't it be nice to be able to replace such long lines 

`pkg install sdl2_mixer sdl2_image sdl2_net`

with something like this? ;-)

`pkg install sdl2_*`

And to avoid this:


```
:~ # pkg install sdl2_*
pkg: No match.
```

How to install all packages at once? 

Another example: 


```
pkg install octave-forge-civil-engineering 
pkg install octave-forge-communications
pkg install octave-forge-control
pkg install octave-forge-database
pkg install octave-forge-dataframe
pkg install octave-forge-dicom
pkg install octave-forge-divand
pkg install octave-forge-doctest
pkg install octave-forge-econometrics
```
 
and so on.

Just compare it to
`pkg install octave-forge-*`


----------



## any_name_you_wish (Dec 18, 2021)

`apt-get`  understands such wildcards ;-)


----------



## T-Daemon (Dec 18, 2021)

any_name_you_wish said:


> `apt-get` understands such wildcards ;-)


So does pkg(8).

If you look in pkg-install(8) you will find

```
-g, --glob
                Treat the package names as shell glob patterns.
```
For the examples above that would be `pkg install -g 'octave-forge-*'`.


----------



## any_name_you_wish (Dec 18, 2021)

That's great.

Thank you!


----------

