logo
yeti.sh
Extract base name & extension in bash
Initializing search
    yeti.sh
    • Home
    • Articles
    • Cv
    • Ideas
    • Projects
    yeti.sh
    • Home
    • Articles
      • Extract base name & extension in bash
      • Terminal recorder
      • tmux
      • Apology of the walrus operator
      • Cs111
        • Bounds, extremum, & infimum
        • Cantor's theorem
        • Functions
        • Max & Min
        • Relations
        • Algebraic structures
          • Abelian Group
          • Field
          • Group
          • Monoid
          • Ring
      • Mkdocs blog plugins
    • Cv
    • Ideas
      • interplanner
      • Terry
          • Communicate with plugins via stdin & stdout
          • Communication Format
          • JSON-RPC messages are annotated with LD contexts
    • Projects

    Extract base name & extension in bash

    bash-3.2$ FILENAME=somefile.tar.gz
    bash-3.2$ echo "${FILENAME%%.*}"
    somefile
    bash-3.2$ echo "${FILENAME%.*}"
    somefile.tar
    
    Previous Articles
    Next Terminal recorder
    Copyright © 2021 Anatoly Scherbakov
    Made with Material for MkDocs