https://github.com/benapetr/freename
freename utility to find a free name for a new file
https://github.com/benapetr/freename
Last synced: about 1 month ago
JSON representation
freename utility to find a free name for a new file
- Host: GitHub
- URL: https://github.com/benapetr/freename
- Owner: benapetr
- Created: 2019-11-04T23:01:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T20:15:09.000Z (over 6 years ago)
- Last Synced: 2025-02-22T11:43:02.861Z (over 1 year ago)
- Language: C
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
freename
===========
This is an extremely simple and fast C utility written for UNIX,
its purpose is to quickly find an available file name for use in
shell scripts and so on.
It's a faster replacement for alternative hack in shell script,
which is aimed to be more flexible in the future.
Basic usage is to provide a filename as an argument with optional
string(s) `$counter` that will be replaced with an actual counter.
If counter variable is not provided, filename has .$counter appended.
Examples:
```
# No files "x" exist:
$ ./freename x
x
$ touch x
$ ./freename x
x.0
$ touch x.0
$ ./freename x
x.1
$ touch `./freename x`
$ touch `./freename x`
$ ./freename x
x.3
```