Questions tagged [bash]
This challenge is related to the Bash (Bourne Again SHell) language. Note that challenges that require the answers to be in a specific language are generally discouraged.
9 questions
2
votes
1
answer
344
views
Code Golfing in Bash
I'm pretty new to code golfing, but I recently came across a guy on Kattis that consistently has exactly 5 character Bash solutions for some problems. For example, here is a leaderboard showing his 5 ...
1
vote
1
answer
278
views
Most elegant one-liner to generate sqlite INSERTs
Challenge
You find yourself in a bash terminal, and want to do some simple tests
on sqlite3.
So you issue the following command:
...
-4
votes
4
answers
320
views
tail: troll: file truncated
Background
When you run tail -f file in bash, the file is outputted and then any subsequent appends.
However, when you remove something that has already been ...
6
votes
4
answers
558
views
Shorter way to assign a default value to the standard output stream
I have this code :
tr ' ' '\n'|sort -n|head -1
The code is pretty simple, it takes a list of integer in the standard input stream (like ...
70
votes
43
answers
13k
views
Tips for golfing in Bash
What general tips do you have for golfing in Bash? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Bash (e.g. "remove comments" is not ...