{"id":13587482,"url":"https://github.com/brutus/bash-slugify","last_synced_at":"2026-03-17T22:52:41.020Z","repository":{"id":32924585,"uuid":"36520206","full_name":"brutus/bash-slugify","owner":"brutus","description":"Create slugs and rename files — in your shell.","archived":false,"fork":false,"pushed_at":"2021-03-25T11:16:36.000Z","size":26,"stargazers_count":27,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-02-14T21:50:44.139Z","etag":null,"topics":["bash","shell","slugify"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brutus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T17:52:23.000Z","updated_at":"2023-09-18T00:33:33.000Z","dependencies_parsed_at":"2022-07-17T03:30:31.600Z","dependency_job_id":null,"html_url":"https://github.com/brutus/bash-slugify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutus%2Fbash-slugify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutus%2Fbash-slugify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutus%2Fbash-slugify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutus%2Fbash-slugify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brutus","download_url":"https://codeload.github.com/brutus/bash-slugify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247740722,"owners_count":20988259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","shell","slugify"],"created_at":"2024-08-01T15:06:13.931Z","updated_at":"2025-04-07T22:31:17.585Z","avatar_url":"https://github.com/brutus.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# BASH Slugify\n\nIt slugifies strings. In your BASH. Well, I need to clean filenames — like\nuploaded images — regularly and this helps me automate it.\n\n\n## What's happening?\n\n- _Optionally_ convert to upper- or lower case (default: no change).\n\n- _Optionally_ all *special chars* (`[^a-zA-Z0-9]`) are removed or replaced\n  (default: `_`).\n\n- _Optionally_ all or some *glue characters* (`[-_.]`) are replaced with spaces.\n\n- Whitespace is consolidated and trimmed.\n\n- All remaining spaces are replaced (default: `-`).\n\n\n## Examples\n\n    $ ./slugify.sh foo 'Hello World!' Bar\n    foo\n    Hello-World!\n    Bar\n\n    $ ./slugify.sh foo -l 'Hello World!' Bar\n    foo\n    hello-world!\n    bar\n\n    $ ./slugify.sh -e foo 'Hello World!' Bar\n    foo-Hello-World!-Bar\n\n    $ ./slugify.sh -exl foo Hello World! Bar\n    foo-hello-world-bar\n\nIf you use the `-r` switch, arguments are threated as file names to be slugifed\n(and renamed). Here's the output if you run it dry (no renaming) in the\ndirectory of this repository — `$ ./slugify.sh -rn -lx *`:\n\n    CHANGELOG.md -\u003e changelog.md\n    LICENSE -\u003e license\n    README.md -\u003e readme.md\n    src -\u003e skipped (no change)\n    tests -\u003e skipped (no change)\n\n\n## Usage\n\n    Slugifies strings or filenames.\n\n    usage: slugify [(l|u)|(x|X)|E|D|U|P|A|S|(c\u003c char\u003e|s)|C\u003c char\u003e|e|r|n|f|v|d|h]… \u003cstring\u003e…\n\n    character options\n      -l  convert to lowercase\n      -u  convert to uppercase\n      -x  remove special chars\n      -X  replace special chars\n\n    space options\n      -D  don't convert dashes to spaces\n      -U  don't convert underscores to spaces\n      -P  don't convert dots (points) to spaces\n      -A  don't remove spaces around dashes and underscores\n      -S  don't consolidate multiple spaces\n\n    replacement options\n      -c \u003cchar\u003e replace all spaces with this (default: '-')\n      -C \u003cchar\u003e replace special chars with this (default: '_')\n      -s use underscores for spaces (shortcut for '-c_')\n\n    mode options\n      -e  extended — treat all arguments as one string and echo one slug for it\n      -r  rename files – treat arguments as filenames and rename them\n\n    rename options\n      -E  don't slugify file extensions\n      -n  dry run — only show new file names (no renaming)\n      -f  force — overwrite existing files\n\n    other options\n      -v  verbose output\n      -d  debug output\n      -h  print help\n\n### Return Values\n\n- `0` all went well\n- `1` error parsing arguments\n- `2` original string is empty\n- `3` slugified string is empty\n- `4` original file not found\n- `5` slugified file exists\n\n\n## Development\n\nTested with [Bats]. Okay just barely…\n\n\n[bats]: https://github.com/sstephenson/bats\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrutus%2Fbash-slugify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrutus%2Fbash-slugify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrutus%2Fbash-slugify/lists"}