2 ms·
Here's three different ways to write a small shell script that turns letters into uppercase: Node: let inputData = ''; process.stdin.on('data', chunk
by williamcotton 2y ago
Here's three different ways to write a small shell script that turns letters into uppercase:
Node:
let inputData = '';
process.stdin.on('data',
chunk => inputData += chunk
);
process.stdin.on('end',
() => console.log(inputData.toUpperCase())
);
Python:
import sys
sys.stdout.write(
sys.stdin.read().upper()
)
Ruby:
puts $stdin.read.upcase
- racketprogram 2y agoconsole.log(require('fs').readFileSync(0).toString().toLowerCase())