Questions tagged [one-liner]

One Liners are an abridged one-line version of a multi-line script.

Originally, a one-liner program was textual input to the command-line of an operating system shell that performs some function in just one line of input. The one-liner can be

  • an expression written in the language of the shell;
  • the invocation of an interpreter together with program source for the interpreter to run;
  • the invocation of a compiler together with source to compile and instructions for executing the compiled program.

Certain dynamic scripting languages such as AWK, sed, and Perl have traditionally been adept at expressing one-liners. Shell interpreters such as Unix shells or Windows PowerShell allow for the construction of powerful one-liners.

The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.

Find more information at:

153 questions
-4
votes
3 answers

Python combine function

Today i'll publish a riddle. The best answer will be the shortest code. Write a one liner function that accepts a currency and a list of numbers. The function needs to return a string where each number from the list is attached with its…
T.Stimer
  • 255
  • 1
  • 2
  • 8
-5
votes
1 answer

Combining summary statistics from multiple input files in Bash

I want to generate some Summary statistics for "Mary" based on data in multiple files. input1.txt looks like Jose 88518 95 75 95 62 100 78 68 Alex 97502 84 79 80 73 88 95 79 85 93 Mary 98765 80 75 100 51 83 75 99 50 75 89 94 ... input2.txt looks…
-5
votes
1 answer

Assemble oneliners from multiline PS script

Need to manipulate ICS from command line batch script, but did not found suitable console tool. But found powershell script which do such task. The problem is the script is multiline and as I have zero experiences with PS, looking for someone who…
user2956477
  • 1,208
  • 9
  • 17
1 2 3
10
11