document.write("<div class=\"pastie\">\n");
document.write("  <link href=\"http://pastie.org/stylesheets/embed.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  <link href=\"http://pastie.org/stylesheets/clean.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  \n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("	\n");
document.write("	<div class=\"allcode\">\n");
document.write("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n");
document.write("		<tr>\n");
document.write("			<td>\n");
document.write("				\n");
document.write("				<pre class=\"textmate-source-numbers\">1\n");
document.write("2\n");
document.write("3\n");
document.write("4\n");
document.write("5\n");
document.write("6\n");
document.write("7\n");
document.write("8\n");
document.write("9\n");
document.write("10\n");
document.write("11\n");
document.write("12\n");
document.write("13\n");
document.write("14\n");
document.write("15\n");
document.write("16\n");
document.write("17\n");
document.write("18\n");
document.write("19\n");
document.write("20\n");
document.write("21\n");
document.write("<\/pre>\n");
document.write("			<\/td>\n");
document.write("		<td>\n");
document.write("		<pre class=\"textmate-source\"><pre class=\"sunburst\"><span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'>#!/bin/bash<\/span>\n");
document.write("args=<span class=\'variable variable_other variable_other_special variable_other_special_shell\'>$@<\/span>\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>if<\/span> [ <span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`echo &quot;$args&quot;|grep -c &quot;\\-r&quot;`<\/span> -eq 1 ]\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>then<\/span>\n");
document.write("    random=1\n");
document.write("    args=<span class=\'variable variable_other variable_other_bracket variable_other_bracket_shell\'>${args##-r}<\/span> <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># remove -r at the front<\/span>\n");
document.write("    args=<span class=\'variable variable_other variable_other_bracket variable_other_bracket_shell\'>${args%%-r}<\/span> <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># and the back<\/span>\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>else<\/span>\n");
document.write("    random=0 \n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>fi<\/span>\n");
document.write("findr=<span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;find ~/Music -type f |grep <span class=\'constant constant_character constant_character_escape constant_character_escape_shell\'>\\&quot;<\/span>.*\\.mp3<span class=\'constant constant_character constant_character_escape constant_character_escape_shell\'>\\&quot;<\/span> |grep -i <span class=\'constant constant_character constant_character_escape constant_character_escape_shell\'>\\&quot;<\/span><span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`echo $args|sed -e \'s/\\ /<span class=\'constant constant_character constant_character_escape constant_character_escape_shell\'>\\\\<\/span>\\ /g\'`<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_shell\'>\\&quot;<\/span>&quot;<\/span>\n");
document.write("found=<span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`echo &quot;$findr&quot;|bash`<\/span>  <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># dont forget to quote the variable or ya lose newlines!<\/span>\n");
document.write("echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;<span class=\'variable variable_other variable_other_normal variable_other_normal_shell\'>$found<\/span>&quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell\'>|<\/span>sed -e <span class=\'string string_quoted string_quoted_single string_quoted_single_shell\'>\'s/^.*Music\\///g\'<\/span>\n");
document.write("echo Found <span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`echo &quot;$found&quot; | wc -l`<\/span> songs \n");
document.write("echo\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>if<\/span> [ <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;<span class=\'variable variable_other variable_other_normal variable_other_normal_shell\'>$random<\/span>&quot;<\/span> -eq <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;1&quot;<\/span> ] \n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>then<\/span>\n");
document.write("    echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;<span class=\'variable variable_other variable_other_normal variable_other_normal_shell\'>$found<\/span>&quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell\'>|<\/span> <span class=\'keyword keyword_operator keyword_operator_tilde keyword_operator_tilde_shell\'>~<\/span>/scr/binplay -vr\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>else<\/span>\n");
document.write("    echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;<span class=\'variable variable_other variable_other_normal variable_other_normal_shell\'>$found<\/span>&quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell\'>|<\/span> <span class=\'keyword keyword_operator keyword_operator_tilde keyword_operator_tilde_shell\'>~<\/span>/scr/binplay -v\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>fi<\/span>\n");
document.write("<\/pre><\/pre>\n");
document.write("		<\/td>\n");
document.write("		<\/tr>\n");
document.write("		<\/table>\n");
document.write("	\n");
document.write("	<\/div>\n");
document.write("\n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("  <div class=\"credit\">\n");
document.write("    <div class=\"buttons\">\n");
document.write("      <a href=\"http://pastie.org/pastes/465700.txt\">\n");
document.write("      <img src=\"http://pastie.org/images/view.png\" height=\"20\" width=\"67\" /><\/a>\n");
document.write("    <\/div>\n");
document.write("  \n");
document.write("    <a href=\"http://pastie.org/465700\">Pastie #465700<\/a> linked directly from <a href=\"http://pastie.org/\">Pastie<\/a>.\n");
document.write("  <\/div><\/div>");
