http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&action=history&feed=atom Expr command - Revision history 2024-03-29T14:01:11Z Revision history for this page on the wiki MediaWiki 1.10.1 http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=43875&oldid=prev Harjan at 07:39, 30 September 2012 2012-09-30T07:39:27Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:39, 30 September 2012</td> </tr> <tr><td colspan="2" align="left"><strong>Line 6:</strong></td> <td colspan="2" align="left"><strong>Line 6:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> ~ # '''expr 5 <del style="color: red; font-weight: bold; text-decoration: none;"> </del>6'''</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ~ # '''expr 5 <ins style="color: red; font-weight: bold; text-decoration: none;">+ </ins>6'''</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> 11</td><td> </td><td style="background: #eee; font-size: smaller;"> 11</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> </table> Harjan http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=32276&oldid=prev Glenn: catchg 2010-05-08T19:17:13Z <p>catchg</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:17, 8 May 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 27:</strong></td> <td colspan="2" align="left"><strong>Line 27:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Scripts]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Scripts]]</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">[[Category:<del style="color: red; font-weight: bold; text-decoration: none;">commandline command </del>reference]]</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:<ins style="color: red; font-weight: bold; text-decoration: none;">Command-line </ins>reference]]</td></tr> </table> Glenn http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=31689&oldid=prev Glenn: catchg 2010-04-30T14:31:17Z <p>catchg</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:31, 30 April 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 26:</strong></td> <td colspan="2" align="left"><strong>Line 26:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">[[Category:<del style="color: red; font-weight: bold; text-decoration: none;">English documentation</del>]]</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:<ins style="color: red; font-weight: bold; text-decoration: none;">Scripts</ins>]]</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:commandline command reference]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:commandline command reference]]</td></tr> </table> Glenn http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=24413&oldid=prev Alvin at 07:17, 13 February 2009 2009-02-13T07:17:02Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:17, 13 February 2009</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Telnet/SSH_and_the_Command_Line|SSH/Telnet &amp; The CLI]] / expr '''</td><td>+</td><td style="background: #cfc; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage<ins style="color: red; font-weight: bold; text-decoration: none;">]] / [[Index:Scripting|Scripting</ins>]] / [[Telnet/SSH_and_the_Command_Line|SSH/Telnet &amp; The CLI]] / expr '''</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">'''expr''' is the expression command in bourne type shells. On the WRT, expr is handled by busybox.</td><td> </td><td style="background: #eee; font-size: smaller;">'''expr''' is the expression command in bourne type shells. On the WRT, expr is handled by busybox.</td></tr> </table> Alvin http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=23711&oldid=prev Alvin at 19:00, 9 January 2009 2009-01-09T19:00:48Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:00, 9 January 2009</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Telnet/SSH_and_the_Command_Line|SSH/Telnet &amp; The CLI]] / expr '''</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">'''expr''' is the expression command in bourne type shells. On the WRT, expr is handled by busybox.</td><td> </td><td style="background: #eee; font-size: smaller;">'''expr''' is the expression command in bourne type shells. On the WRT, expr is handled by busybox.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td colspan="2" align="left"><strong>Line 4:</strong></td> <td colspan="2" align="left"><strong>Line 6:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">~ # '''expr 5 6'''</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>~ # '''expr 5 6'''</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>11</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">11</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&#160;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">~ # '''expr 39 / 4'''</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">9</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> ~ # '''expr 39 / 4'''</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>9</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Loop counter example:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> #!/bin/sh</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # while lc &lt; 10 do</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> lc=1</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> while [ $lc -lt 10 ] ; do </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> lc=`expr $lc + 1`</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> echo LoopCount: $lc</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Try '''expr --help''' for more details.</td><td> </td><td style="background: #eee; font-size: smaller;">Try '''expr --help''' for more details.</td></tr> </table> Alvin http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=15484&oldid=prev Mj6Qgv at 18:43, 12 April 2007 2007-04-12T18:43:35Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 18:43, 12 April 2007</td> </tr> <tr><td colspan="2" align="left"><strong>Line 4:</strong></td> <td colspan="2" align="left"><strong>Line 4:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">~ # '''expr 5 <del style="color: red; font-weight: bold; text-decoration: none;">+ </del>6'''</td><td>+</td><td style="background: #cfc; font-size: smaller;">~ # '''expr 5 <ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>6'''</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">11</td><td> </td><td style="background: #eee; font-size: smaller;">11</td></tr> </table> Mj6Qgv http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=11928&oldid=prev Gerrys at 19:17, 15 May 2006 2006-05-15T19:17:38Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:17, 15 May 2006</td> </tr> <tr><td colspan="2" align="left"><strong>Line 14:</strong></td> <td colspan="2" align="left"><strong>Line 14:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Try '''expr --help''' for more details.</td><td> </td><td style="background: #eee; font-size: smaller;">Try '''expr --help''' for more details.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:English documentation]]</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:commandline command reference]]</td></tr> </table> Gerrys http://forum.dd-wrt.com/wiki/index.php?title=Expr_command&diff=5272&oldid=prev 70.57.19.177: expr (bourne shell builtin) command - Evaluate Expressions 2006-04-14T15:46:24Z <p>expr (bourne shell builtin) command - Evaluate Expressions</p> <p><b>New page</b></p><div>'''expr''' is the expression command in bourne type shells. On the WRT, expr is handled by busybox.<br /> <br /> '''expr''' takes expressions. The most common expressions deal with simple arithmetic operations:<br /> <br /> <br /> ~ # '''expr 5 + 6'''<br /> <br /> 11<br /> <br /> ~ # '''expr 39 / 4'''<br /> <br /> 9<br /> <br /> <br /> Try '''expr --help''' for more details.</div> 70.57.19.177