Skip to content
This repository

Formatters

[env:]

The [env:] formatter can be used to get the value of an environment variable.

absrenamer -f'[env:USER]_$' hello_world.txt
#=> simonc_hello_world.txt

When the value of a variable contains the / character it is replaced by a -.

echo $HOME
#=> /home/simonc

absrenamer -f'[env:HOME]_$' hello_world.txt
#=> -home-simonc_hello_world.txt

This can be configured in the conf file using the following option:

:options:
  :system_slash_replacement: "_"

absrenamer -f'[env:HOME]_$' hello_world.txt
#=> _home_simonc_hello_world.txt

[sys:]

The [sys:] formatter allow to use the result of a command.

absrenamer -f'[sys:whoami]_$' hello_world.txt
#=> simonc_hello_world.txt

Right only id, uname, hostname and whoami are supported with the following options :

uname -imnoprsv
hostname -s
whoami
id -gnru

absrenamer -f'[sys:uname -m]_$' hello_world.txt
#=> i386_hello_world.txt

Modifiers

As for any […] formatter, the modifiers can be used.

absrenamer -f'[&env:USER]_$' hello_world.txt
#=> SIMONC_hello_world.txt

absrenamer -f'[&sys:uname -m]' hello_world.txt
#=> I386_hello_world.txt
Something went wrong with that request. Please try again.