Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) Safe-mode: OFF (not secure) /var/www/html/ drwxr-xr-x |
Viewing file: Select action/file-type: #!/bin/bash # Função recursiva para percorrer diretórios function process_directory { local dir="$1" for file in "$dir"/*; do if [[ -f "$file" ]]; then # Se o caminho atual for um arquivo filename=$(basename "$file") selected_chars="${filename: -$num_chars}" # Obtenha os últimos $num_chars caracteres # Verifique se o valor já existe no array if [[ ! " ${last_chars_positions[@]} " =~ " ${selected_chars} " ]]; then last_chars_positions+=("$selected_chars") fi elif [[ -d "$file" ]]; then # Se o caminho atual for um diretório, chame a função recursivamente process_directory "$file" fi done } # Inicialize um array vazio last_chars_positions=() # Verifique se o número de caracteres a ser selecionado foi fornecido como argumento if [[ $# -eq 1 ]]; then num_chars=$1 else # Se não foi fornecido, defina um valor padrão de 4 caracteres num_chars=4 fi # Chame a função para processar o diretório atual de forma recursiva process_directory . # Imprima o conteúdo do array echo "Últimos ${num_chars} caracteres únicos dos nomes de arquivos:" for value in "${last_chars_positions[@]}"; do echo "$value" done |
:: Command execute :: | |
--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0041 ]-- |