All pastes #1810489 Raw Edit

raro.sh

public shellscript v1 · immutable
#1810489 ·published 2010-02-25 18:27 UTC
rendered paste body
#!/bin/bash#Pedimos al usuario los valoresread -p "Nombre de archivos a comprimir: " INfileif [ -n $INfile ]then	if [ -f $INfile ]	then		#El usuario ingreso texto, y apunta a un archivo normal, sobre el que tenemos permisos de lectura		echo "Validando ... [OK]"	else		echo "Archivo invalido, o privilegios insuficientes"		exit 1	fielse	echo "Debes ingresar un valor"	exit 1firead -p "Tamao de las partes: " partSizeif [ -n $partSize ]then	if [ $partSize -lt 1 ]		then		echo "El tamao debe ser positivo"		exit 1	else		echo "Validando ... [OK]"	fielse	echo "Debes ingresar un valor"	exit 1firead -p "Nombre del archivo de salida: " OUTfileif [ -n OUTfile ]then	if [ -f OUTfile ]	then		echo "el archivo ya existe"		#quedaria mas lindo preguntar si quiere sobre escribir		exit 1	else		echo "Validando ... [OK]"	fielse	echo "debes ingresar un archivo de salida valido"	exit 1firar a -m0 -v${partes}m ${final}.rar $file