-
I have a folder with a few videos and I wanna occatinally run ffmpeg to extract their audio.
I would pass in a glob string but ┌in ~\test
└❯ glob *.mp4
╭───┬──────────────────────────────────────────╮
│ 0 │ C:\Users\Gremious\test\angry_dog_265.mp4 │
│ 1 │ C:\Users\Gremious\test\who is nl.mp4 │
╰───┴──────────────────────────────────────────╯
............................[04:40:25 PM] [took 1ms]............................
┌in ~\test
└❯ '*.mp4' | into glob
*.mp4 Please, how do I just provide my script a glob/an arbitrary number of files and run |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
i think the thing you are looking for is def main [...files] {
print $files
} ->
when passing aruments to a external command (or script), which does not have a definition nu expands globs ( |
Beta Was this translation helpful? Give feedback.
i think the thing you are looking for is
...
:->
glob
is a datatype likepath
,date
, etc.| into glob
changes a string into this filetype and does not expand it.when passing aruments to a external command (or script), which does not have a definition nu expands globs (
*.txt
-> multiple arguments) in order to be backwards-compatible with POSIX (and generally easier to use). when defining a nushell function you have to define each argument and expanded globs are multiple argument…