1995eaton / rw

a unix command that allows redirecting files to themselves

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rw

a unix command that allows redirecting files to themselves

Usage

seq 100 > example.txt

# commands like this won't work in most shells:

# generate 10 lines of numbers of length 5
tr -cd '[:digit:]' < /dev/urandom | fold -w5 | head -10 > example.txt

# commands like these won't work:
cat example.txt | sort -n | uniq > example.txt
cat example.txt | grep -v '[2468]$' > example.txt
cat example.txt | cat > example.txt

# rw solves this problem:
cat example.txt | sort -n | rw example.txt

About

a unix command that allows redirecting files to themselves

License:MIT License


Languages

Language:C 96.1%Language:Makefile 3.9%