An open API service indexing awesome lists of open source software.

https://github.com/freedomben/tool-in-awk

A quick demo of using Awk in place of easier-to-use unix tools
https://github.com/freedomben/tool-in-awk

Last synced: 4 months ago
JSON representation

A quick demo of using Awk in place of easier-to-use unix tools

Awesome Lists containing this project

README

          

# tool-in-awk

You don't need `` because you can use `awk`!

## cat

Still using `cat` when `awk` is so much more 1337?

Instead of:

```bash
cat *.txt
```

Use:

```bash
awk '{ print }' *.txt
```

## grep

Instead of:

```bash
grep -E '' *.txt
# or
some_command | grep -E ''
```

Use:

```bash
awk '//' *.txt
# or
some_command | awk '//'
```

## sed

Instead of:

```bash
sed -E 's//your replacment/g' *.txt
# or
some_command | sed -E 's//your replacment/g' *.txt
```

Use:

```bash
awk '{ gsub(/command/, "shamand"); print }' *.txt
# or
some_command | awk '{ gsub(/command/, "shamand"); print }'
```

## wc

Instead of:

```bash
wc myfile.txt
```

Use:

```bash
awk '{ w += NF; c += length + 1 }; END {print NR, w, c, FILENAME }' myfile.txt
```

Way easier!

## Conclusion

Use the best tool for the job, and in every possible case, that best tool is `awk`.