A formatting test for David Winterbottom: improving commandlinefu for submitters

echo "?????, these are the umlauted vowels I sing to you. Oh, and sometimes ?, but I don't sing that one cause it doesn't rhyme."
Commandlinefu.com is great but has a few bugs when people are submitting new commands: . 1. There is no preview button. This was a minor inconvenience before, but now is a major problem since new commands won't show up to be edited until they have been moderated. . 2. White space in the description field and in the comments is almost completely lost. People resort to using periods in between paragraphs to force a line break. Indentation of code is ridiculous. . 3. Many characters get munged. . 3a. For example, a less than character in the description gets read as an HTML tag and discarded. In order to type a less than, I've had to type "<" (I hope that comes out right). Unfortunately, when re-editing a command, the HTML entity is turned into a literal less than character, which I have to change back by hand before saving. 3b. Some unicode characters work in the description field, but turn into ugly literal HTML strings when put in the sample output or in an additional command using the $ prefix. . For example, here is a unicode character: ❥ Here is the same character after a dollar sign: ❥ . 3c. Some unicode characters don't work anywhere. Bizarrely, it appears to be the most commonly needed ones, such as Latin-1 accented characters. Here are some examples, . Bullet: ?, Center dot: ?, Umlaut u: ?. . 4. Here is an example of the greater than, >, and less than, . 5. Commandlinefu used to abbreviate long descriptions on the front page and had a "more..." button so that people could read the rest if they wanted. That's a good feature as it encourages people to explain their commands more fully. Either, the feature has gone missing, or, perhaps, I was just hallucinating it existed in the first place. If the former, please bring it back, If the latter, please implement this great new feature I just thought up. . 6. Tags cannot include Unicode characters. If you try to type one in, the cursor will just spin and spin as it attempt to look up if that tag exists already. For example, try typing Ctrl+Shift+u 2 7 6 5 SPC as a tag name.
Sample Output
echo "?????, these are the umlauted vowels I sing to you. Oh, and sometimes ?."
Here is U+2022: ?, which should look like a big bullet point, not an HTML entity.
$ ugrep '\bpi\b' | grep MATH
𝚷	U+1D6B7	MATHEMATICAL BOLD CAPITAL PI
𝛑	U+1D6D1	MATHEMATICAL BOLD SMALL PI
𝛡	U+1D6E1	MATHEMATICAL BOLD PI SYMBOL
𝛱	U+1D6F1	MATHEMATICAL ITALIC CAPITAL PI
𝜋	U+1D70B	MATHEMATICAL ITALIC SMALL PI
𝜛	U+1D71B	MATHEMATICAL ITALIC PI SYMBOL
𝜫	U+1D72B	MATHEMATICAL BOLD ITALIC CAPITAL PI
𝝅	U+1D745	MATHEMATICAL BOLD ITALIC SMALL PI
𝝕	U+1D755	MATHEMATICAL BOLD ITALIC PI SYMBOL
𝝥	U+1D765	MATHEMATICAL SANS-SERIF BOLD CAPITAL PI
𝝿	U+1D77F	MATHEMATICAL SANS-SERIF BOLD SMALL PI
𝞏	U+1D78F	MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
𝞟	U+1D79F	MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI
𝞹	U+1D7B9	MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI
𝟉	U+1D7C9	MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL

13
By: hackerb9
2011-01-05 05:56:20

These Might Interest You

  • Faster then other method using wget For obtain all commands use nu=`curl http://www.commandlinefu.com/commands/browse |grep -o "Terminal - All commands -.*results$" | grep -oE "[[:digit:],]{4,}" | sed 's/,//'`; curl http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-"$nu":25] | grep -vE "_curl_|\.com by David" > clf-ALL.txt For more version specific nu=`curl http://www.commandlinefu.com/commands/browse |grep -o "Terminal - All commands -.*results$" | grep -oE "[[:digit:],]{4,}" | sed 's/,//'`; curl http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-"$nu":25] | grep -vE "_curl_|\.com by David" > clf-ALL_"$nu".txt Also download dirctly from my dropbox My drop box invitaion link is http://db.tt/sRdJWvQq . Use it and get free 2.5 GB space. Show Sample Output


    2
    curl http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-9000:25] | grep -vE "_curl_|\.com by David" > clf-ALL.txt
    totti · 2011-11-08 12:19:48 0
  • Same as http://www.commandlinefu.com/commands/view/5876, but for bash. This will show a numerical value for each of the 256 colors in bash. Everything in the command is a bash builtin, so it should run on any platform where bash is installed. Prints one color per line. If someone is interested in formatting the output, paste the alternative.


    45
    for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done
    scribe · 2010-06-19 02:14:42 4
  • This command might not be useful for most of us, I just wanted to share it to show power of command line. Download simple text version of novel David Copperfield from Poject Gutenberg and then generate a single column of words after which occurences of each word is counted by sort | uniq -c combination. This command removes numbers and single characters from count. I'm sure you can write a shorter version. Show Sample Output


    -4
    wget -q -O- http://www.gutenberg.org/dirs/etext96/cprfd10.txt | sed '1,419d' | tr "\n" " " | tr " " "\n" | perl -lpe 's/\W//g;$_=lc($_)' | grep "^[a-z]" | awk 'length > 1' | sort | uniq -c | awk '{print $2"\t"$1}'
    alperyilmaz · 2009-05-04 16:00:39 8
  • it is not work with Cygwin's bash3.X. Test in Linux. use printf "%'f" number while it is floating point number Show Sample Output


    3
    printf "%'d\n" 1234567
    twfcc · 2009-08-15 14:48:56 1

What Others Think

On the other hand, commandlinefu is an English language only site so there are very few cases where characters outside the ascii range are in any way necessary or even useful.
TheMightyBuzzard · 388 weeks and 6 days ago
All good points. Will add to the to-do list. Am going to delete this post in 24 hours though as it's not a real command.
root · 388 weeks and 5 days ago
Thanks for deleting this, root. I hadn't actually expected it to be approved by the moderators.
hackerb9 · 388 weeks and 5 days ago
@root: Is the todo list public? Are you taking suggestions? Is there a forum for comments about the site? Is the site code public?
flatcap · 388 weeks and 5 days ago
Why is this still online?
dan · 342 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: