Skip to main content

Thread: mass script generator?


i have hundreds of .zip n64 games. want write small scripts each 1 @ once using line in each script:

there program create script command in each script proper .zip filename, , name script same .zip filename?

i.e.

1. scans mortalcombat.zip (file)

2. inputs in script, mupen64plus --fullscreen --nogui --noosd /mnt/tera/roms/mortalcombat.zip

3 names script mortalcombat.sh

you forgot
4 chmod +x mortalcombat.sh (besides kombat)

can create script act universal launcher, let's run_game.sh
code:
#!/bin/bash  echo mupen64plus --fullscreen --nogui --noosd "$1"
or alias in shell configuration - best option
gedit ~/.bashrc , find section aliases , add own
code:
alias run_game='mupen64plus --fullscreen --nogui --noosd'
you run run_game mk2.zip (and shell if tapped tab autocomplete existing file names)

if want generate scripts each existing zip
code:
for z in *.zip; scr="${z%.zip}.sh"; echo $'#!/bin/bash\n\nmupen64plus --fullscreen --nogui --noosd "'"$z"'"' > "$scr"; chmod +x "$scr"; done


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] mass script generator?


Ubuntu

Comments

Popular posts from this blog

Object Fitting Keyboard Shortcuts Disfuntional

Markers not showing up after opening a saved project. Where did they go!?

[bug] Windows Vista - Microphone - FP 11.8.800.94