home.social

#unixshell — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #unixshell, aggregated by home.social.

fetched live
  1. Think I've got enough #ksh implementations installed? XD

    rld@Intrepid:~$ pkg info |grep ksh
    ksh-1.0.10                     ksh93u+m is the renewed development of ksh93 based on AT&T ksh93u+m (stable)
    mksh-59c_3                     MirBSD Korn Shell
    oksh-7.8,1                     Portable OpenBSD Korn shell
    pdksh-5.2.14p2_7               The Public Domain Korn Shell
    rld@Intrepid:~$ 
    

    #mksh #pdksh #oksh #testing #unix #unixShell #ShellScripting

  2. Think I've got enough #ksh implementations installed? XD

    rld@Intrepid:~$ pkg info |grep ksh
    ksh-1.0.10                     ksh93u+m is the renewed development of ksh93 based on AT&T ksh93u+m (stable)
    mksh-59c_3                     MirBSD Korn Shell
    oksh-7.8,1                     Portable OpenBSD Korn shell
    pdksh-5.2.14p2_7               The Public Domain Korn Shell
    rld@Intrepid:~$ 
    

    #mksh #pdksh #oksh #testing #unix #unixShell #ShellScripting

  3. Think I've got enough #ksh implementations installed? XD

    rld@Intrepid:~$ pkg info |grep ksh
    ksh-1.0.10                     ksh93u+m is the renewed development of ksh93 based on AT&T ksh93u+m (stable)
    mksh-59c_3                     MirBSD Korn Shell
    oksh-7.8,1                     Portable OpenBSD Korn shell
    pdksh-5.2.14p2_7               The Public Domain Korn Shell
    rld@Intrepid:~$ 
    

    #mksh #pdksh #oksh #testing #unix #unixShell #ShellScripting

  4. Think I've got enough #ksh implementations installed? XD

    rld@Intrepid:~$ pkg info |grep ksh
    ksh-1.0.10                     ksh93u+m is the renewed development of ksh93 based on AT&T ksh93u+m (stable)
    mksh-59c_3                     MirBSD Korn Shell
    oksh-7.8,1                     Portable OpenBSD Korn shell
    pdksh-5.2.14p2_7               The Public Domain Korn Shell
    rld@Intrepid:~$ 
    

    #mksh #pdksh #oksh #testing #unix #unixShell #ShellScripting

  5. Think I've got enough #ksh implementations installed? XD

    rld@Intrepid:~$ pkg info |grep ksh
    ksh-1.0.10                     ksh93u+m is the renewed development of ksh93 based on AT&T ksh93u+m (stable)
    mksh-59c_3                     MirBSD Korn Shell
    oksh-7.8,1                     Portable OpenBSD Korn shell
    pdksh-5.2.14p2_7               The Public Domain Korn Shell
    rld@Intrepid:~$ 
    

    #mksh #pdksh #oksh #testing #unix #unixShell #ShellScripting

  6. In the #shell #functions I should have written years ago category...

    function fedilinktousername {
        grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
    }
    
    function fediusernametolink {
        grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
    }
    
    rld@Intrepid:~$ clipo
    https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
    rld@Intrepid:~$ clipo |fedilinktousername 
    @[email protected]
    rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
    https://polymaths.social/@rl_dane
    rld@Intrepid:~$ 
    

    #UnixShell #ShellScripting #Unix #bash #ksh

  7. In the #shell #functions I should have written years ago category...

    function fedilinktousername {
        grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
    }
    
    function fediusernametolink {
        grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
    }
    
    rld@Intrepid:~$ clipo
    https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
    rld@Intrepid:~$ clipo |fedilinktousername 
    @[email protected]
    rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
    https://polymaths.social/@rl_dane
    rld@Intrepid:~$ 
    

    #UnixShell #ShellScripting #Unix #bash #ksh

  8. In the #shell #functions I should have written years ago category...

    function fedilinktousername {
        grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
    }
    
    function fediusernametolink {
        grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
    }
    
    rld@Intrepid:~$ clipo
    https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
    rld@Intrepid:~$ clipo |fedilinktousername 
    @[email protected]
    rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
    https://polymaths.social/@rl_dane
    rld@Intrepid:~$ 
    

    #UnixShell #ShellScripting #Unix #bash #ksh

  9. In the #shell #functions I should have written years ago category...

    function fedilinktousername {
        grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
    }
    
    function fediusernametolink {
        grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
    }
    
    rld@Intrepid:~$ clipo
    https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
    rld@Intrepid:~$ clipo |fedilinktousername 
    @[email protected]
    rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
    https://polymaths.social/@rl_dane
    rld@Intrepid:~$ 
    

    #UnixShell #ShellScripting #Unix #bash #ksh

  10. In the #shell #functions I should have written years ago category...

    function fedilinktousername {
        grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
    }
    
    function fediusernametolink {
        grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
    }
    
    rld@Intrepid:~$ clipo
    https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
    rld@Intrepid:~$ clipo |fedilinktousername 
    @[email protected]
    rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
    https://polymaths.social/@rl_dane
    rld@Intrepid:~$ 
    

    #UnixShell #ShellScripting #Unix #bash #ksh

  11. Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

    year=$( date +%Y)
    month=$(date +%m)
    day=$(  date +%d)
    

    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

  12. Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

    year=$( date +%Y)
    month=$(date +%m)
    day=$(  date +%d)
    

    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

  13. Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

    year=$( date +%Y)
    month=$(date +%m)
    day=$(  date +%d)
    

    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

  14. Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

    year=$( date +%Y)
    month=$(date +%m)
    day=$(  date +%d)
    

    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

  15. Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

    year=$( date +%Y)
    month=$(date +%m)
    day=$(  date +%d)
    

    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

  16. I... I... I don't know what to say.

    I may have a problem. XD

    rld@Intrepid:~$ wc -l .bash_[af]* .bashrc*
         399 .bash_aliases
        1886 .bash_functions
         468 .bashrc2
        2753 total
    rld@Intrepid:~$ grep -c '^[^#]*function ' .bash_functions 
    157
    rld@Intrepid:~$ 
    

    #Unix #Shell #UnixShell #ShellAddict

  17. I... I... I don't know what to say.

    I may have a problem. XD

    rld@Intrepid:~$ wc -l .bash_[af]* .bashrc*
         399 .bash_aliases
        1886 .bash_functions
         468 .bashrc2
        2753 total
    rld@Intrepid:~$ grep -c '^[^#]*function ' .bash_functions 
    157
    rld@Intrepid:~$ 
    

    #Unix #Shell #UnixShell #ShellAddict

  18. I... I... I don't know what to say.

    I may have a problem. XD

    rld@Intrepid:~$ wc -l .bash_[af]* .bashrc*
         399 .bash_aliases
        1886 .bash_functions
         468 .bashrc2
        2753 total
    rld@Intrepid:~$ grep -c '^[^#]*function ' .bash_functions 
    157
    rld@Intrepid:~$ 
    

    #Unix #Shell #UnixShell #ShellAddict

  19. I... I... I don't know what to say.

    I may have a problem. XD

    rld@Intrepid:~$ wc -l .bash_[af]* .bashrc*
         399 .bash_aliases
        1886 .bash_functions
         468 .bashrc2
        2753 total
    rld@Intrepid:~$ grep -c '^[^#]*function ' .bash_functions 
    157
    rld@Intrepid:~$ 
    

    #Unix #Shell #UnixShell #ShellAddict

  20. I... I... I don't know what to say.

    I may have a problem. XD

    rld@Intrepid:~$ wc -l .bash_[af]* .bashrc*
         399 .bash_aliases
        1886 .bash_functions
         468 .bashrc2
        2753 total
    rld@Intrepid:~$ grep -c '^[^#]*function ' .bash_functions 
    157
    rld@Intrepid:~$ 
    

    #Unix #Shell #UnixShell #ShellAddict

  21. Highest system load I've seen (while the system was still responsive, that is):

    Thu Apr 16 05:02:25 PM CDT 2026 83.95 (6.995 per processor (12))
    

    Was batch converting ~250 jpegs into avif, running 16 processes concurrently.
    #UnixShell makes it stupidly easy. :D

    (hint: ncpus=$(lscpu -bp |grep -c "^[0-9]"); while (( $(jobs) >= ncpus )); do sleep 1; done ;)

  22. Highest system load I've seen (while the system was still responsive, that is):

    Thu Apr 16 05:02:25 PM CDT 2026 83.95 (6.995 per processor (12))
    

    Was batch converting ~250 jpegs into avif, running 16 processes concurrently.
    #UnixShell makes it stupidly easy. :D

    (hint: ncpus=$(lscpu -bp |grep -c "^[0-9]"); while (( $(jobs) >= ncpus )); do sleep 1; done ;)

  23. Highest system load I've seen (while the system was still responsive, that is):

    Thu Apr 16 05:02:25 PM CDT 2026 83.95 (6.995 per processor (12))
    

    Was batch converting ~250 jpegs into avif, running 16 processes concurrently.
    #UnixShell makes it stupidly easy. :D

    (hint: ncpus=$(lscpu -bp |grep -c "^[0-9]"); while (( $(jobs) >= ncpus )); do sleep 1; done ;)

  24. Highest system load I've seen (while the system was still responsive, that is):

    Thu Apr 16 05:02:25 PM CDT 2026 83.95 (6.995 per processor (12))
    

    Was batch converting ~250 jpegs into avif, running 16 processes concurrently.
    #UnixShell makes it stupidly easy. :D

    (hint: ncpus=$(lscpu -bp |grep -c "^[0-9]"); while (( $(jobs) >= ncpus )); do sleep 1; done ;)

  25. Highest system load I've seen (while the system was still responsive, that is):

    Thu Apr 16 05:02:25 PM CDT 2026 83.95 (6.995 per processor (12))
    

    Was batch converting ~250 jpegs into avif, running 16 processes concurrently.
    #UnixShell makes it stupidly easy. :D

    (hint: ncpus=$(lscpu -bp |grep -c "^[0-9]"); while (( $(jobs) >= ncpus )); do sleep 1; done ;)

  26. Something that I'd love to be able to do, but haven't figured out how, yet:

    You can run somecommand 2>&1 > log.txt to get STDOUT and STDERR together, but you won't know which is which.
    You can run somecommand 2>err.txt >log.txt to get STDOUT and STDERR separate, but you won't know the timing, or which error messages happened between which STDOUT messages.
    I'd like to figure out some way to combine both, so you end up with a file like this:

    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    1: this was a STDOUT message
    2: this was a STDERR message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    

    Any ideas? @mirabilos?

    #Unix #UnixShell #Linux #BSD

  27. Something that I'd love to be able to do, but haven't figured out how, yet:

    You can run somecommand 2>&1 > log.txt to get STDOUT and STDERR together, but you won't know which is which.
    You can run somecommand 2>err.txt >log.txt to get STDOUT and STDERR separate, but you won't know the timing, or which error messages happened between which STDOUT messages.
    I'd like to figure out some way to combine both, so you end up with a file like this:

    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    1: this was a STDOUT message
    2: this was a STDERR message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    

    Any ideas? @mirabilos?

    #Unix #UnixShell #Linux #BSD

  28. Something that I'd love to be able to do, but haven't figured out how, yet:

    You can run somecommand 2>&1 > log.txt to get STDOUT and STDERR together, but you won't know which is which.
    You can run somecommand 2>err.txt >log.txt to get STDOUT and STDERR separate, but you won't know the timing, or which error messages happened between which STDOUT messages.
    I'd like to figure out some way to combine both, so you end up with a file like this:

    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    1: this was a STDOUT message
    2: this was a STDERR message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    

    Any ideas? @mirabilos?

    #Unix #UnixShell #Linux #BSD

  29. Something that I'd love to be able to do, but haven't figured out how, yet:

    You can run somecommand 2>&1 > log.txt to get STDOUT and STDERR together, but you won't know which is which.
    You can run somecommand 2>err.txt >log.txt to get STDOUT and STDERR separate, but you won't know the timing, or which error messages happened between which STDOUT messages.
    I'd like to figure out some way to combine both, so you end up with a file like this:

    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    1: this was a STDOUT message
    2: this was a STDERR message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    

    Any ideas? @mirabilos?

    #Unix #UnixShell #Linux #BSD

  30. Something that I'd love to be able to do, but haven't figured out how, yet:

    You can run somecommand 2>&1 > log.txt to get STDOUT and STDERR together, but you won't know which is which.
    You can run somecommand 2>err.txt >log.txt to get STDOUT and STDERR separate, but you won't know the timing, or which error messages happened between which STDOUT messages.
    I'd like to figure out some way to combine both, so you end up with a file like this:

    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    1: this was a STDOUT message
    2: this was a STDERR message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    1: this was a STDOUT message
    2: this was a STDERR message
    2: this was a STDERR message
    

    Any ideas? @mirabilos?

    #Unix #UnixShell #Linux #BSD

  31. Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD

    #slightly easier wireguard command
    function wg {
        local dir file profile profiledir= parm=${1:-} statustext
        #Find profile dir
        for dir in {,/usr/local}/etc/wireguard; do
            if [[ -d $dir ]]; then
                profiledir=$dir
                break
            fi
        done
        #Find config file
        if [[ -n $profiledir ]]; then
            for file in $profiledir/*.conf; do
                if [[ -e $file ]]; then
                    profile=${file//*\/}
                    profile=${profile/.conf}
                    break
                fi
            done
        fi
        [[ -n $profile ]] || profile=proton
        statustext="wireguard profile $profile"
        case ${parm,,} in
            up|on)      doas wg-quick  up  $profile;;
            down|off)   doas wg-quick down $profile;;
            status)     echo -en "$statustext _______\r"
                        echo -en "$statustext "
                        ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
            *)          warn "wg usage: wg up|down|status";;
        esac
    }
    

    Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.

    #Unix #UnixShell #ShellScript #ShellScripting

  32. Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD

    #slightly easier wireguard command
    function wg {
        local dir file profile profiledir= parm=${1:-} statustext
        #Find profile dir
        for dir in {,/usr/local}/etc/wireguard; do
            if [[ -d $dir ]]; then
                profiledir=$dir
                break
            fi
        done
        #Find config file
        if [[ -n $profiledir ]]; then
            for file in $profiledir/*.conf; do
                if [[ -e $file ]]; then
                    profile=${file//*\/}
                    profile=${profile/.conf}
                    break
                fi
            done
        fi
        [[ -n $profile ]] || profile=proton
        statustext="wireguard profile $profile"
        case ${parm,,} in
            up|on)      doas wg-quick  up  $profile;;
            down|off)   doas wg-quick down $profile;;
            status)     echo -en "$statustext _______\r"
                        echo -en "$statustext "
                        ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
            *)          warn "wg usage: wg up|down|status";;
        esac
    }
    

    Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.

    #Unix #UnixShell #ShellScript #ShellScripting

  33. Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD

    #slightly easier wireguard command
    function wg {
        local dir file profile profiledir= parm=${1:-} statustext
        #Find profile dir
        for dir in {,/usr/local}/etc/wireguard; do
            if [[ -d $dir ]]; then
                profiledir=$dir
                break
            fi
        done
        #Find config file
        if [[ -n $profiledir ]]; then
            for file in $profiledir/*.conf; do
                if [[ -e $file ]]; then
                    profile=${file//*\/}
                    profile=${profile/.conf}
                    break
                fi
            done
        fi
        [[ -n $profile ]] || profile=proton
        statustext="wireguard profile $profile"
        case ${parm,,} in
            up|on)      doas wg-quick  up  $profile;;
            down|off)   doas wg-quick down $profile;;
            status)     echo -en "$statustext _______\r"
                        echo -en "$statustext "
                        ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
            *)          warn "wg usage: wg up|down|status";;
        esac
    }
    

    Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.

    #Unix #UnixShell #ShellScript #ShellScripting

  34. Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD

    #slightly easier wireguard command
    function wg {
        local dir file profile profiledir= parm=${1:-} statustext
        #Find profile dir
        for dir in {,/usr/local}/etc/wireguard; do
            if [[ -d $dir ]]; then
                profiledir=$dir
                break
            fi
        done
        #Find config file
        if [[ -n $profiledir ]]; then
            for file in $profiledir/*.conf; do
                if [[ -e $file ]]; then
                    profile=${file//*\/}
                    profile=${profile/.conf}
                    break
                fi
            done
        fi
        [[ -n $profile ]] || profile=proton
        statustext="wireguard profile $profile"
        case ${parm,,} in
            up|on)      doas wg-quick  up  $profile;;
            down|off)   doas wg-quick down $profile;;
            status)     echo -en "$statustext _______\r"
                        echo -en "$statustext "
                        ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
            *)          warn "wg usage: wg up|down|status";;
        esac
    }
    

    Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.

    #Unix #UnixShell #ShellScript #ShellScripting

  35. Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD

    #slightly easier wireguard command
    function wg {
        local dir file profile profiledir= parm=${1:-} statustext
        #Find profile dir
        for dir in {,/usr/local}/etc/wireguard; do
            if [[ -d $dir ]]; then
                profiledir=$dir
                break
            fi
        done
        #Find config file
        if [[ -n $profiledir ]]; then
            for file in $profiledir/*.conf; do
                if [[ -e $file ]]; then
                    profile=${file//*\/}
                    profile=${profile/.conf}
                    break
                fi
            done
        fi
        [[ -n $profile ]] || profile=proton
        statustext="wireguard profile $profile"
        case ${parm,,} in
            up|on)      doas wg-quick  up  $profile;;
            down|off)   doas wg-quick down $profile;;
            status)     echo -en "$statustext _______\r"
                        echo -en "$statustext "
                        ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
            *)          warn "wg usage: wg up|down|status";;
        esac
    }
    

    Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.

    #Unix #UnixShell #ShellScript #ShellScripting

  36. I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.

    alias cd..='cd ..'
    

    #bash #UNIX #Shell #UnixShell #POSIX

  37. I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.

    alias cd..='cd ..'
    

    #bash #UNIX #Shell #UnixShell #POSIX

  38. I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.

    alias cd..='cd ..'
    

    #bash #UNIX #Shell #UnixShell #POSIX

  39. I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.

    alias cd..='cd ..'
    

    #bash #UNIX #Shell #UnixShell #POSIX

  40. I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.

    alias cd..='cd ..'
    

    #bash #UNIX #Shell #UnixShell #POSIX

  41. Recursion usually scares me a bit, but it worked out nicely here:

    #convert "cx"-style Esperanto notation to native accents (ĉ)
    function eaccent {
        if [[ ${1:-} ]]; then
            echo "$*" |eaccent
        else
            sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
        fi
    }
    

    #bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto

  42. Recursion usually scares me a bit, but it worked out nicely here:

    #convert "cx"-style Esperanto notation to native accents (ĉ)
    function eaccent {
        if [[ ${1:-} ]]; then
            echo "$*" |eaccent
        else
            sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
        fi
    }
    

    #bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto

  43. Recursion usually scares me a bit, but it worked out nicely here:

    #convert "cx"-style Esperanto notation to native accents (ĉ)
    function eaccent {
        if [[ ${1:-} ]]; then
            echo "$*" |eaccent
        else
            sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
        fi
    }
    

    #bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto

  44. Recursion usually scares me a bit, but it worked out nicely here:

    #convert "cx"-style Esperanto notation to native accents (ĉ)
    function eaccent {
        if [[ ${1:-} ]]; then
            echo "$*" |eaccent
        else
            sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
        fi
    }
    

    #bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto

  45. Recursion usually scares me a bit, but it worked out nicely here:

    #convert "cx"-style Esperanto notation to native accents (ĉ)
    function eaccent {
        if [[ ${1:-} ]]; then
            echo "$*" |eaccent
        else
            sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
        fi
    }
    

    #bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto

  46. Quick tip if you ever need to add a linebreak to the end of a file manually for whatever reason, `echo >> filename` works.

  47. Quick tip if you ever need to add a linebreak to the end of a file manually for whatever reason, `echo >> filename` works.

    #Linux #Shell #UnixShell #LinuxShell #Bash

  48. Quick tip if you ever need to add a linebreak to the end of a file manually for whatever reason, `echo >> filename` works.

    #Linux #Shell #UnixShell #LinuxShell #Bash

  49. Quick tip if you ever need to add a linebreak to the end of a file manually for whatever reason, `echo >> filename` works.

    #Linux #Shell #UnixShell #LinuxShell #Bash

  50. Quick tip if you ever need to add a linebreak to the end of a file manually for whatever reason, `echo >> filename` works.

    #Linux #Shell #UnixShell #LinuxShell #Bash

  51. When you're dealing with plaintext data in a suspicious context, consider using `cat -v` where you'd usually use `cat`.

    ```
    -v, --show-nonprinting
    use ^ and M- notation, except for LFD and TAB
    ```

    #UnixShell #commandLine #Linux #LinuxTips #cybersecurity