[haiku-es] Re: [haiku-es] Re: Duda con Scripts, ventanas y presentación

  • From: Tana <tanausugomez@xxxxxxxxx>
  • To: haiku-es@xxxxxxxxxxxxx
  • Date: Tue, 24 Feb 2009 13:04:40 +0100

Muchas gracias :) he logrado hacer que funcione mas o menos bien con esto:

--------------------
#!/bin/sh
#Organizer 0.1

MENSAJE=$"El script organizer.sh ordenará sus archivos por extensión en categorí­as, por favor, elija el directorio que quiere ordenar."
HOME=$"/home"
DWN=$"/home/Downloads"

value=$(alert  --idea "$MENSAJE" "$HOME" "$DWN" "Salir")

if [ "$value" = "$HOME" ]; then
mkdir -p /boot/home//Videos ;
mkdir -p /boot/home/Music ;
mkdir -p /boot/home/Pdf ;
mkdir -p /boot/home/Compress_Files ;
mkdir -p /boot/home/Text ;
mkdir -p /boot/home/Pictures ;
mkdir -p /boot/home/Packages ;
mv *.zip /boot/home/Compress_Files ;
mv *.rar /boot/home/Compress_Files ;
mv *.7z /boot/home/Compress_Files ;
mv *.arj /boot/home/Compress_Files ;
mv *.tgz /boot/home/Compress_Files ;
mv *.txt /boot/home/Text ;
mv *.doc /boot/home/Text ;
mv *.pdf /boot/home/Pdf;
mv *.pkg /boot/home/Packages ;
mv *.zpkg /boot/home/Packages ;
mv *.zip.pkg /boot/home/Packages ;
mv *.mp3 /boot/home/Music ;
mv *.jpg /boot/home/Pictures ;
mv *.bmp /boot/home/Pictures ;
mv *.gif /boot/home/Pictures ;
mv *.png /boot/home/Pictures ;
mv *.tga /boot/home/Pictures ;
mv *.jpeg /boot/home/Pictures ;
mv screenshot* /boot/home/Pictures ;
mv *.ico /boot/home/Pictures ;
mv *.pcx /boot/home/Pictures ;
mv *.rle /boot/home/Pictures ;
mv *.pic /boot/home/Pictures ;
mv *.iff /boot/home/Pictures ;
mv *.rgb /boot/home/Pictures ;
mv *.avi /boot/home/Videos ;
mv *.mpg /boot/home/Videos ;
mv *.divx /boot/home/Videos ;
mv *.xvid /boot/home/Videos ;
mv *.flv /boot/home/Videos ;
mv *.mp4 /boot/home/Videos ;
mv *.asf /boot/home/Videos ;
mv *.mov /boot/home/Videos ;
mv *.wmv /boot/home/Videos ;
mv *.3gp /boot/home/Videos ;
fi

if [ "$value" = "$DWN" ]; then
mkdir -p /boot/home/Downloads/Videos ;
mkdir -p /boot/home/Downloads/Music ;
mkdir -p /boot/home/Downloads/Pdf ;
mkdir -p /boot/home/Downloads/Compress_Files ;
mkdir -p /boot/home/Downloads/Text ;
mkdir -p /boot/home/Downloads/Pictures ;
mkdir -p /boot/home/Downloads/Packages ;
mv *.zip /boot/home/Downloads/Compress_Files ;
mv *.rar /boot/home/Downloads/Compress_Files ;
mv *.7z /boot/home/Downloads/Compress_Files ;
mv *.arj /boot/home/Downloads/Compress_Files ;
mv *.tgz /boot/home/Downloads/Compress_Files ;
mv *.txt /boot/home/Downloads/Text ;
mv *.doc /boot/home/Downloads/Text ;
mv *.pdf /boot/home/Downloads/Pdf;
mv *.pkg /boot/home/Downloads/Packages ;
mv *.zpkg /boot/home/Downloads/Packages ;
mv *.zip.pkg /boot/home/Downloads/Packages ;
mv *.mp3 /boot/home/Downloads/Music ;
mv *.jpg /boot/home/Downloads/Pictures ;
mv screenshot* /boot/home/Downloads/Pictures ;
mv *.bmp /boot/home/Downloads/Pictures ;
mv *.gif /boot/home/Downloads/Pictures ;
mv *.png /boot/home/Downloads/Pictures ;
mv *.tga /boot/home/Downloads/Pictures ;
mv *.jpeg /boot/home/Downloads/Pictures ;
mv *.ico /boot/home/Downloads/Pictures ;
mv *.pcx /boot/home/Downloads/Pictures ;
mv *.rle /boot/home/Downloads/Pictures ;
mv *.pic /boot/home/Downloads/Pictures ;
mv *.iff /boot/home/Downloads/Pictures ;
mv *.rgb /boot/home/Downloads/Pictures ;
mv *.avi /boot/home/Downloads/Videos ;
mv *.mpg /boot/home/Downloads/Videos ;
mv *.divx /boot/home/Downloads/Videos ;
mv *.xvid /boot/home/Downloads/Videos ;
mv *.flv /boot/home/Downloads/Videos ;
mv *.mp4 /boot/home/Downloads/Videos ;
mv *.asf /boot/home/Downloads/Videos ;
mv *.mov /boot/home/Downloads/Videos ;
mv *.wmv /boot/home/Downloads/Videos ;
mv *.3gp /boot/home/Downloads/Videos ;
fi

if [ "$value" = "Salir" ]; then
exit
fi
----------------


He tenido que sustituir el ~/ por el /boot/home/ porque por alguna extraña razón dentro del if no me creaba los directorios y ahora he pensado... se podría poner "$HOME"/Videos por ejemplo, o sea, usar una variable en vez de una ruta,? Esta noche sigo experimentando a ver que sale,  gracias a todos por la ayuda.

Una captura de pantalla aquí

Saludos!

Other related posts: