• [^] # Re: taille de binaire

    Posté par (Mastodon) . En réponse au lien exa is unmaintained.... Évalué à 4. Dernière modification le 11 septembre 2023 à 13:30.

    Moi je préfère cette fonction que j'ai ajouté à mon .bashrc :

    sl() {
     # Derivative work (script to function) of sl bash script
     # https://gir.st/blog/sl-alt.htm
     # Copyright (C) 2018 - Tobias Girstmair
     #
     # This program is free software: you can redistribute it and/or modify
     # it under the terms of the GNU General Public License as published by
     # the Free Software Foundation, either version 3 of the License, or
     # (at your option) any later version.
     #
     # This program is distributed in the hope that it will be useful,
     # but WITHOUT ANY WARRANTY; without even the implied warranty of
     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     # GNU General Public License for more details.
     #
     # You should have received a copy of the GNU General Public License
     # along with this program. If not, see <https://www.gnu.org/licenses/>.
     LEN=$(ls "$@" | wc -L) # get the length of the longest line
     ls "$@" | rev | while read -r line; do
     printf "%${LEN}.${LEN}s\\n" "$line" | sed 's/^\(\s\+\)\(\S\+\)/2円1円/'
     done
    }