NOTE: This site use JavaScript which appears to be turned off. Most content will be fine, but some things won't work.
#!/bin/bash EXAMPLE_PATH="path/to/example-file.txt" BASENAME=$(basename "$EXAMPLE_PATH") STEM="${BASENAME%.*}" echo $STEM
example-file