|
From: El O. De M. <obs...@gm...> - 2024-03-02 04:30:55
|
I could not adapt the examples to what i want.
I tried to use the assistance of LLMs and went to test the following:
#!/bin/bash
# Specify the root directory
root_directory="C:/Users/Usuario/Downloads/Task"
# Loop through each subdirectory
for subdir in "$root_directory"/*; do
if [ -d "$subdir" ]; then
# Run the find command to delete directories in each subdirectory
find "$subdir" -type d ! \( -name 'Common-Lisp' -o -name 'Maxima' \)
-exec rm -r {} +
fi
done
but does not run in vscode because the path can not be found
By the way, the file i want to modify can be found here:
https://github.com/acmeism/RosettaCodeData/tree/main/Task
I think i must learn more about command line commands.
Best regards
El vie, 1 mar 2024 a las 13:23, Michel Talon (<ta...@lp...>)
escribió:
> Like this:
>
> Zbox:~$ mkdir A
>
> Zbox:~$ maxima -q
> (%i1) load("operatingsystem");
> (%o1)
> /usr/share/maxima/5.42.2/share/contrib/operatingsystem/operatingsystem.mac
> (%i2) for i from 1 thru 10 do mkdir(string(A/concat(B,i)));
> (%o2) done
> (%i3) for i from 1 thru 10 do if oddp(i) then rmdir(string(A/concat(B,i)));
> (%o3) done
> (%i4)
>
> Exit maxima
>
> Zbox:~$ ls A
> B10 B2 B4 B6 B8
>
> Le 01/03/2024 à 18:23, El Observatorio De Matemática a écrit :
> > Hi list
> >
> > I want to handle a folder with more than 70000 files and 50000
> > directories and delete from it several files and directories using
> > Maxima, if it is possible.
> > There is a package in contrib named operatingsystem that potentially
> > can do this task but i can not figure out how to use it.
> >
> --
> Michel Talon
>
>
>
> _______________________________________________
> Maxima-discuss mailing list
> Max...@li...
> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>
|