fork download
  1. bash -xs -- /opt
Success #stdin #stdout #stderr 0s 4548KB
stdin
#!/bin/bash
#Dependencias
declare -a dependencias=( "unzip" "wget" "curl" "mkdir" "tree" )
#command -V unzip
echo "Content-Type: text/plain"
echo
PATH_ROOT=$1

if [ -z "$PATH_ROOT" ]; then
      echo "\$PATH_ROOT esta vacia, debe indicar el directorio raiz"
      exit;
else

       for i in "${dependencias[@]}"; do
              command -V $i
              if [ $? = 1 ]; then
                  exit;
              fi
        done

fi
stdout
Content-Type: text/plain

unzip is /usr/bin/unzip
wget is /usr/bin/wget
curl is /usr/bin/curl
mkdir is /usr/bin/mkdir
stderr
+ dependencias=("unzip" "wget" "curl" "mkdir" "tree")
+ declare -a dependencias
+ echo 'Content-Type: text/plain'
+ echo
+ PATH_ROOT=/opt
+ '[' -z /opt ']'
+ for i in "${dependencias[@]}"
+ command -V unzip
+ '[' 0 = 1 ']'
+ for i in "${dependencias[@]}"
+ command -V wget
+ '[' 0 = 1 ']'
+ for i in "${dependencias[@]}"
+ command -V curl
+ '[' 0 = 1 ']'
+ for i in "${dependencias[@]}"
+ command -V mkdir
+ '[' 0 = 1 ']'
+ for i in "${dependencias[@]}"
+ command -V tree
bash: line 15: command: tree: not found
+ '[' 1 = 1 ']'
+ exit