< Back to IRCAM Forum

Om-shell and {..}

Hello,

I have 101 wavs in /myfolder named foo_000.wav until foo_100.wav. I want to remove only the first 11 files, so I tried in om-shell:

“cd /myfolder && rm *{000…010}.wav”

but I got on the listener:

:: cd /myfolder && rm {000…010}.wav
:: rm: cannot remove '
{000…010}.wav’: No such file or directory
OM => 1

also I tried:

“cd /myfolder && rm *[0-10].wav”

which is working but also erases other files (eg foo_011.wav) as expected.

The first command is working as expected on the terminal. How can I make it work with om-shell?

thanks & regards
rc

(ubuntu 20.04 & om 6.17)

Hi RC
I think the problem you have here is the path. You should put the complete path to your folder, because om-shell will be by default in the OM folder. so try with:
“cd /home/you/myfolder && etc…”
wherever your folder is… (here i assume that the folder is in the root folder of your home.

Best
K

Hi K,

Thanks for your quick reply.
The /myfolder is just an example. I use the full path and I think that it is not the problem since the second example with [-] is working. This happens only when I try using {…}

best,
rc

ok sorry,

use instead:
sys:run-shell-command with “cd /myfolder && rm *{000…010}.wav”
(just ctrl-click in the patch and type sys:run-shell-command, and put your command line)
However you will not have an output in the listener but in the terminal.
I will see if i can wrap this better for next release.

om-shell seems to have some limitations…

Best
K

It works. Thank you K!
If there’s a place where I can find more info about sys:run-shell-command and similar please let me know. I’m interested but google doesn’t throw me any result.
best,
rc

You can find it here:
http://www.lispworks.com/documentation/lw60/LW/html/lw-1376.htm
with most of LW commands,

Best
Have fun and take care
K