Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prefix_with

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prefix_with

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

prefix_with

A CLI utility to prefix lines fed through the STDIN with its arguments.

Installation

$ gem install prefix_with

Use case

Imagine deleting all *.txt files from a deeply nested folder structure. xargs may be the tool that comes to mind - to prefix with the rm command infront of a filtered list of files, like:

$ find . | grep "*.txt" | xargs rm

The problem I find with this is that, mostly the command breaks because there are spaces in the file names or that there might be a few files that we may require. May be it was better to see the command thats going to get executed prior to execution. If that makes sense, this is the tool that will help in it. I know space issue can be handled, but didn't feel it as an elegant solution.

$ find . | grep "*.txt" | prefix_with rm | sh

Credits

I saw this as a small script that one of my friends - Nikhil Mohan was using. Packaging as a gem hoping it would be useful for someone.

FAQs

Package last updated on 22 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc