7 kyu

Parsing Commandline Arguments

79 of 322btaitelb

Description:

We're given some typical *nix commands and want to parse them into their arguments. We'll ignore quoted arguments and other special characters, although if any of the characters &, ;, >, | show up, those signify that a new command has started (so we can ignore any arguments after it).

##Examples

  1. ls -R / ["ls", "-R", "/"]

  2.    cat   /tmp/data.txt | less

      ["cat", "/tmp/data.txt"]
    

(note that we ignored the extra leading spaces on that last example)

Parsing
Regular Expressions
Fundamentals

More By Author:

Check out these other kata created by btaitelb

Stats:

CreatedMay 13, 2015
PublishedMay 13, 2015
Warriors Trained852
Total Skips224
Total Code Submissions1894
Total Times Completed322
Ruby Completions79
JavaScript Completions257
Total Stars15
% of votes with a positive feedback rating86% of 118
Total "Very Satisfied" Votes93
Total "Somewhat Satisfied" Votes18
Total "Not Satisfied" Votes7
Total Rank Assessments40
Average Assessed Rank
6 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • btaitelb Avatar
  • ZozoFouchtra Avatar
  • Voile Avatar
  • farhanaditya Avatar
Ad