Path Parts

Easy · Variables & Expansion · Parameter expansion

Problem

A path such as /var/log/system.log arrives as the first argument.

Print the filename on the first line, and the filename without its extension on the second — using parameter expansion, not basename.

Examples

Input: /var/log/system.log
Output: system.log
system

Approaches

Related problems

Start free on Cariara · Coding problems · System design studio

Starting Python
No results yet.

          
↑↓ move ↵ open esc close

Labs

Loading labs…

Run with your own input

Starting Python

Loading Python…