It's just nonsense, well don't watch it if you don't want to Don't be mad at me (why is not a question)

charls1001000

New Member
Joined
Apr 8, 2024
Messages
16
Reaction score
1
Credits
209
The last thing I want them to see is discomfort, the only thing I want is for everything to change and for us to be happy wizards,


apptimecounter.sh
xDonativexTransfor.sh
øauto☄ejecutar_random.sh


Script 1 :

#!/bin/bash

# Paso 1: Obtener un nombre de archivo aleatorio del directorio 'Sala'
nombre_archivo=$(ls Sala | shuf -n 1 | sed 's/\.[^.]*$//')

# Paso 2: Mostrar un cuadro con Zenity indicando el nombre
zenity --info --text="Vas a donar a $nombre_archivo"

# Paso 3: Preguntar cuánto desea donar
donacion_maxima=$(zenity --entry --title="Donación" --text="¿Cuánto deseas donar? (mínimo $2)")

# Validar la entrada
if ! [[ "$donacion_maxima" =~ ^[0-9]+([.][0-9]+)?$ ]] || (( $(echo "$donacion_maxima < 2" | bc -l) )); then
zenity --error --text="La cantidad mínima para donar es $2."
exit 1
fi

# Paso 4: Generar un número aleatorio entre 2 y el valor especificado
donacion=$((RANDOM % (donacion_maxima - 2 + 1) + 2))

# Paso 5: Mostrar mensaje de confirmación
zenity --info --text="Donarás \$$donacion a la compañía $nombre_archivo."

# Paso 6: Crear un archivo de texto con la información de la donación
archivo="Pagaré $nombre_archivo.txt"
echo "Donaráse \$$donacion a la compañía $nombre_archivo." > "$archivo"






Script 2 :

#!/bin/bash

# Obtener la ruta del directorio donde se encuentra el script
DIR="$(dirname "$(realpath "$0")")"

# Seleccionar un archivo o directorio aleatorio dentro del directorio actual (sin subdirectorios)
FILE=$(find "$DIR" -mindepth 1 -maxdepth 1 ! -name ".directory" | shuf -n 1)
FILE_PATH="$FILE"

# Comprobar si el archivo o directorio es un directorio
if [ -d "$FILE_PATH" ]; then
echo "Abriendo directorio: $FILE_PATH"
xdg-open "$FILE_PATH"
exit 0
fi

# Comprobar si el archivo es ejecutable
if [ -x "$FILE_PATH" ]; then
echo "Ejecutando archivo: $FILE"
"$FILE_PATH"
elif [[ "$FILE" == *.sh ]]; then
echo "Ejecutando script de shell: $FILE"
bash "$FILE_PATH"
else
echo "Abriendo archivo: $FILE"
xdg-open "$FILE_PATH"
fi

Screenshot_20241217_142948.png
 

Attachments

  • Screenshot_20241217_142948.png
    Screenshot_20241217_142948.png
    109 KB · Views: 39


?????????????????????????????
 
yeah, I agree with @APTI ...????????

English would be nice....might help the understanding bit....... @charls1001000
 
I usually am pretty strict about using English but I make an exception for things like system settings and scripts where the comments are in their native language or the output from the commands is in their native language.

That said, I have no idea what they're on about - but they did warn us that it was nonsense. It's right there in the title.
 


Members online


Top