Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révision Les deux révisions suivantes | ||
tutoriel:script_shell [Le 13/10/2021, 20:26] Amiralgaby structure + code balisé amélioré |
tutoriel:script_shell [Le 20/02/2022, 08:55] 88.170.129.244 Auto player funky friday roblox |
||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
---- | ---- | ||
- | ====== Introduction aux scripts shell ====== | + | loadstring(game:HttpGet("https://raw.githubusercontent.com/wally-rblx/funky-friday-autoplay/main/main.lua",true))() |
- | + | ||
- | Un script shell permet d'automatiser une série d'opérations. Il se présente sous la forme d'un fichier contenant une ou plusieurs commandes qui seront exécutées de manière séquentielle. | + | |
- | <code bash> | + | |
- | #!/bin/bash | + | |
- | # This script will take an animated GIF and delete every other frame | + | |
- | # Accepts two parameters: input file and output file | + | |
- | # Usage: ./<scriptfilename> input.gif output.gif | + | |
- | + | ||
- | # Make a copy of the file | + | |
- | cp "$1" "$2" | + | |
- | + | ||
- | # Get the number of frames | + | |
- | numframes=$(gifsicle --info "$1" \ | + | |
- | | grep --perl-regexp --only-matching '\d+ images' \ | + | |
- | | grep --perl-regexp --only-matching '\d+') | + | |
- | + | ||
- | # Deletion | + | |
- | let i=0 | + | |
- | while test $i -lt $numframes | + | |
- | do | + | |
- | rem=$(( $i % 2 )) | + | |
- | + | ||
- | if test $rem -eq 0 | + | |
- | then | + | |
- | gifsicle "$2" --delete "#"$(($i/2)) -o "$2" | + | |
- | fi | + | |
- | + | ||
- | let i=i+1 | + | |
- | done | + | |
- | </code> | + | |
=====Pour faire qu'un script soit exécutable ===== | =====Pour faire qu'un script soit exécutable ===== |