How to set child process’ environment variable in Makefile

I would like to change this Makefile: SHELL := /bin/bash PATH := node_modules/.bin:$(PATH) boot: @supervisor \ –harmony \ –watch etc,lib \ –extensions js,json \ –no-restart-on error \ lib test: NODE_ENV=test mocha \ –harmony \ –reporter spec \ test clean: @rm -rf node_modules .PHONY: test clean to: SHELL := /bin/bash PATH := node_modules/.bin:$(PATH) boot: @supervisor \ … Read more

Rename multiple files by replacing a particular pattern in the filenames using a shell script [duplicate]

This question already has answers here: Rename multiple files based on pattern in Unix (23 answers) Closed 4 years ago. Write a simple script that will automatically rename a number of files. As an example we want the file *001.jpg renamed to user defined string + 001.jpg (ex: MyVacation20110725_001.jpg) The usage for this script is … Read more

How to use `jq` in a shell pipeline?

I can’t seem to get jq to behave “normally” in a shell pipeline. For example: $ curl -s https://api.github.com/users/octocat/repos | jq | cat results in jq simply printing out its help text*. The same thing happens if I try to redirect jq‘s output to a file: $ curl -s https://api.github.com/users/octocat/repos | jq > /tmp/stuff.json Is … Read more