Skip to content

Allow to only run command when given pattern is matched #17

@ngirard

Description

@ngirard

Hi and happy new year,

Given the most general running scenario involving a pattern

rargs -p <pattern> <cmd>

I'm unsure whether it makes sense to run cmd no matter if the pattern is matched ; but at least I can tell that it is not always what I expect from Rargs.

Take for instance the common scenario when some files, e.g.

1. Some name
10. Another name

need to be renamed like

01. Some name
10. Another name

There, I wish I was able to type

ls |rargs -p '^(\d\..*)' -- mv "'{1}'" "'0{1}'"

but it wouldn't currently work since Rargs would execute mv for both files, instead of the first one only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions