-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.html
More file actions
2249 lines (2236 loc) · 92 KB
/
shell.html
File metadata and controls
2249 lines (2236 loc) · 92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<link rel="icon" type="image/gif" href="/favicon.gif"/>
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png" />
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png" />
<title>Lorem Ipsum</title>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<style type="text/css" id="internal-style">
@import url(hyperpolyglot.css);
</style>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta http-equiv="content-language" content="en"/>
</head>
<body>
<div id="container-wrap-wrap">
<div id="container-wrap">
<div id="container">
<div id="header">
<h1><a href="/"><span>Hyperpolyglot</span></a></h1>
</div>
<div id="content-wrap">
<div id="main-content">
<div id="page-title">Lorem Ipsum</div>
<div id="page-content">
<p><em>a side-by-side reference sheet</em></p>
<p><a href="#grammar-execution">grammar and execution</a> | <a href="#var-expr">variables and expression</a> | <a href="#arithmetic-logic">arithmetic and logic</a> | <a href="#strings">strings</a> | <a href="#regexes">regexes</a> | <a href="#dates-time">dates and time</a> | <a href="#arrays">arrays</a> | <a href="#functions">functions</a> | <a href="#execution-control">execution control</a> | <a href="#exceptions">exceptions</a> | <a href="#streams">streams</a> | <a href="#files">files</a> | <a href="#directories">directories</a> | <a href="#processes-environment">processes and environment</a> | <a href="#libraries-namespaces">libraries and namespaces</a> | <a href="#reflection">reflection</a> | <a href="#debugging-profiling">debugging and profiling</a></p>
<table class="wiki-content-table">
<tr>
<th><a name="general"></a></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="version-used"></a><a href="#version-used-note">version used</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>dash; POSIX 2008</em></span></td>
<td><span style="color: gray"><em>6.3</em></span></td>
<td><span style="color: gray"><em>4.0</em></span></td>
</tr>
<tr>
<td><a name="version"></a><a href="#version-note">show version</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td> </td>
<td><span style="color: gray"><em>displayed at startup</em></span></td>
<td>$host.version</td>
</tr>
<tr>
<th colspan="4"><a name="grammar-execution"></a><a href="#grammar-execution-note">grammar and execution</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="interpreter"></a><a href="#interpreter-note">interpreter</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>$ dash foo.sh</td>
<td><span style="color: gray"><em>when foo.bat is in the search path:</em></span><br />
<span style="white-space: pre-wrap;">></span> foo</td>
<td><span style="white-space: pre-wrap;">PS></span> .\foo.ps1<br />
<br />
<span style="white-space: pre-wrap;">DOS></span> powershell -file foo.ps1</td>
</tr>
<tr>
<td><a name="repl"></a><a href="#repl-note">repl</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>$ dash</td>
<td><span style="white-space: pre-wrap;">></span> cmd</td>
<td><span style="white-space: pre-wrap;">></span> powershell</td>
</tr>
<tr>
<td><a name="exec-and-exit"></a><a href="#exec-and-exit-note">execute command and exit</a></td>
<td>$ dash -c 'echo hi'</td>
<td><span style="white-space: pre-wrap;">></span> cmd /c "echo hi"</td>
<td><span style="white-space: pre-wrap;">></span> powershell -command 'write-output "hi"'</td>
</tr>
<tr>
<td><a name="stmt-separator"></a><a href="#stmt-separator-note">statement separator</a></td>
<td><span style="color: gray"><em>pipelines separated by</em></span><br />
; & && @</td>
<td>@<br />
<br />
<span style="color: gray"><em>lists of pipelines separated by newlines unless newline is preceded by a backslash or inside these characters:</em></span><br />
"" '' <span style="white-space: pre-wrap;">``</span> ()</td>
<td><span style="color: gray">//pipelines separated by//</span> & && @</td>
<td>@<br />
<br />
<span style="color: gray"><em>lists of pipelines separated by newline unless preceded by caret ^ which is not inside double quote "</em></span></td>
<td>; <span style="color: gray">//or newline; a newline can be escaped with a backtick://</span> <span style="white-space: pre-wrap;">`</span> <span style="color: gray"><em>newlines are permitted in double quotes and after a pipe:</em></span> | </td>
</tr>
<tr>
<td><a name="word-separator"></a><a href="#word-separator-note">word separators</a></td>
<td> | & ; ( ) < > <span style="color: gray"><em>space tab</em></span></td>
<td> | & < > <span style="color: gray"><em>space tab</em></span></td>
<td> </td>
</tr>
<tr>
<td><a name="esc-special-char"></a><a href="#esc-special-char-note">escape special character</a></td>
<td><span style="color: gray"># write "foo" to foo.txt:</span><br />
echo foo > foo.txt<br />
<br />
<span style="color: gray"># write "foo > foo.txt" to stdout:</span><br />
echo foo \> foo.txt</td>
<td><span style="color: gray">rem write "foo" to foo.txt</span><br />
echo foo > foo.txt<br />
<br />
<span style="color: gray">rem write "foo > foo.txt" to stdout:</span><br />
echo foo ^> foo.txt</td>
<td> </td>
</tr>
<tr>
<td><a name="block-delimiters"></a><a href="#block-delimiters-note">block delimiters</a></td>
<td>{<span style="color: gray"><em>...</em></span>}<br />
(<span style="color: gray"><em>...</em></span>)<br />
do <span style="color: gray"><em>...</em></span> done</td>
<td>( <span style="color: gray"><em>...</em></span> )</td>
<td>{ <span style="color: gray"><em>...</em></span> }</td>
</tr>
<tr>
<td><a href="#expression-statement">are expressions statements</a></td>
<td><span style="color: gray"><em>no</em></span></td>
<td><span style="color: gray"><em>no<br />
<br />
relational expressions can only be used in the conditional of an</em> if <em>statement<br />
<br />
arithmetic expressions can only be assigned to a variable using</em> set /a</span></td>
<td><span style="color: gray"><em>yes</em></span></td>
</tr>
<tr>
<td><a name="comment"></a><a href="#comment-note">end-of-line comment</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td> # <span style="color: gray"><em>comment</em></span></td>
<td> rem <span style="color: gray"><em>comment</em></span><br />
<br />
:: <span style="color: gray"><em>comment</em></span></td>
<td># <span style="color: gray"><em>comment</em></span></td>
</tr>
<tr>
<td><a name="multiline-comment"></a><a href="#multiline-comment-note">comment out multiple lines</a></td>
<td><span style="white-space: pre-wrap;"><<</span>EOF<br />
<span style="color: gray"><em>comment</em></span><br />
<span style="color: gray"><em>another comment</em></span><br />
EOF</td>
<td>goto comment<br />
<span style="color: gray"><em>comment</em></span><br />
<span style="color: gray"><em>another comment</em></span><br />
:comment</td>
<td><# <span style="color: gray"><em>comment</em></span><br />
<span style="color: gray">//another comment//</span> #</td>
</tr>
<tr>
<th colspan="4"><a name="var-expr"></a><a href="#var-expr-note">variables and expressions</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="assignment"></a><a href="#assignment-note">assignment</a></td>
<td>a=1<br />
<span style="color: gray"><em>whitespace next to</em></span> = <span style="color: gray"><em>not permitted</em></span></td>
<td>set a=1</td>
<td>$a = 1</td>
</tr>
<tr>
<td><a name="parallel-assignment"></a><a href="#parallel-assignment-note">parallel assignment</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>$a, $b = 1, 2</td>
</tr>
<tr>
<td><a name="swap"></a><a href="#swap-note">swap</a></td>
<td>tmp=$a<br />
a=$b<br />
b=$tmp</td>
<td>set tmp=%a%<br />
set a=%b%<br />
set b=%tmp%</td>
<td>$a, $b = $b, $a</td>
</tr>
<tr>
<td><a name="compound-assignment"></a><a href="#compound-assignment-note">compound assignment operators: arithmetic, string, bit</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>+= -= *= /= %=<br />
<span style="color: gray"><em>none</em></span><br />
<<= >>= &= |= ^=</td>
<td>+= -= *= /= %=<br />
+= *=<br />
<span style="color: gray"><em>none</em></span></td>
</tr>
<tr>
<td><a name="incr-decr"></a><a href="#incr-decr-note">increment and decrement</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>$x = 1<br />
$x<span style="white-space: pre-wrap;">++</span><br />
$x<span style="white-space: pre-wrap;">--</span></td>
</tr>
<tr>
<td><a name="var-decl"></a><a href="#var-decl-note">variable declaration</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>assignment</em></span>, export, readonly</td>
<td><span style="color: gray"><em>assignment</em></span></td>
<td><span style="color: gray"><em>assignment</em></span></td>
</tr>
<tr>
<td><a name="identifiers-case-sensitive"></a><a href="#identifiers-case-sensitive-note">are identifiers case sensitive?</a></td>
<td><span style="color: gray"><em>yes</em></span></td>
<td><span style="color: gray"><em>no</em></span></td>
<td><span style="color: gray"><em>no</em></span></td>
</tr>
<tr>
<td><a name="null"></a><a href="#null-note">null</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>''</td>
<td><span style="color: gray"><em>Variables must contain a non-empty string. This deletes the variable x:</em></span><br />
set x=</td>
<td>$null</td>
</tr>
<tr>
<td><a name="null-test"></a><a href="#null-test-note">null test</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>if [ -z $v ]<br />
then<br />
<span style="white-space: pre-wrap;"> </span>echo not defined<br />
fi</td>
<td>if not defined v echo not defined</td>
<td>$v -eq $null</td>
</tr>
<tr>
<th colspan="4"><a name="arithmetic-logic"></a><a href="#arithmetic-logic-note">arithmetic and logic</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="true-false"></a><a href="#true-false-note">true and false</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>status codes:</em></span><br />
true false<br />
<br />
<span style="color: gray"><em>inside</em> [ ]:</span><br />
1 ''</td>
<td><span style="color: gray"><em>no booleans; conditional of if statement must contain a relational expression</em></span></td>
<td>$true $false</td>
</tr>
<tr>
<td><a name="falsehoods"></a><a href="#falsehoods-note">falsehoods</a></td>
<td><span style="color: gray"><em>status codes:<br />
nonzero integers</em></span><br />
<br />
<span style="color: gray"><em>inside</em> [ ]:</span><br />
''</td>
<td><span style="color: gray"><em>relational expressions which evaluate to false</em></span></td>
<td>0 0.0 "" ''</td>
</tr>
<tr>
<td><a name="logical-ops"></a><a href="#logical-ops-note">logical operators</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>status codes:</em></span><br />
&& @</td>
<td>@@ !<br />
<br />
<span style="color: gray"><em>inside</em> [ ]:</span><br />
-a -o ! </td>
<td><span style="color: gray"><em>short-circuit operators:</em></span><br />
&& @</td>
<td>@<br />
<br />
<span style="color: gray"><em>inside conditional of if:</em></span><br />
not</td>
<td>-and -or -not</td>
</tr>
<tr>
<td><a name="conditional-expr"></a><a href="#conditional-expr-note">conditional expression</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>$(( x>0 ? x : -x ))</td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
</tr>
<tr>
<td><a href="#relational-expr">relational expression</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>[ $a -gt 3 ]</td>
<td>%a% gtr 3</td>
<td>$a -gt 3</td>
</tr>
<tr>
<td><a href="#relational-operators">relational operators</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>integers:</em></span><br />
-eq -ne -gt -lt -ge -le<br />
<br />
<span style="color: gray"><em>strings:</em></span><br />
<span style="white-space: pre-wrap;">=</span> != > < <span style="color: gray"><em>none</em></span> <span style="color: gray"><em>none</em></span></td>
<td>equ neq gtr lss geq leq</td>
<td>-eq -ne -gt -lt -ge -le</td>
</tr>
<tr>
<td><a href="#arithmetic-expr">arithmetic expression</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>$(( 1 + 3 ))</td>
<td><span style="color: gray"><em>arithmetic expression must be stored in a variable:</em></span><br />
set /a "foo=1+3"</td>
<td>1 + 3</td>
</tr>
<tr>
<td><a href="#arithmetic-operators">arithmetic operators</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>+ - * <span style="color: gray">//none//</span> / % <span style="white-space: pre-wrap;">**</span><br />
<br />
<span style="color: gray"><em>operators are integer-only in most shells; use</em> bc <em>for float arithmetic</em></span></td>
<td>+ - * <span style="color: gray"><em>none</em></span> / % <span style="color: gray"><em>none</em></span><br />
<br />
<span style="color: gray"><em>operators only work on integers</em></span></td>
<td>+ - * / <span style="color: gray"><em>??</em></span> % <span style="color: gray"><em>??</em></span></td>
</tr>
<tr>
<td><a href="#integer-division">integer division</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>$(( $a / $b ))</td>
<td>set /a "result=7/3"</td>
<td>$rem = $null<br />
$quot = [Math]::DivRem($a, $b, [ref] $rem)</td>
</tr>
<tr>
<td><a name="int-div-zero"></a><a href="#int-div-zero-note">integer division by zero</a></td>
<td><span style="color: gray"><em>writes "division by 0" error message; statement terminates with a 1 status</em></span></td>
<td><span style="color: gray"><em>Writes "Divide by zero error." and sets %errorlevel% to nonzero value.</em></span></td>
<td><span style="color: gray"><em>error: Attempted to divide by zero</em></span></td>
</tr>
<tr>
<td><a href="#float-division">float division</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="white-space: pre-wrap;">`</span>echo " scale=5; $a / $b " | bc<span style="white-space: pre-wrap;">`</span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>$a / $b</td>
</tr>
<tr>
<td><a name="float-div-zero"></a><a href="#float-div-zero-note">float division by zero</a></td>
<td><span style="color: gray"><em>writes "division by 0" error message; statement terminates with a 1 status</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>evaluates to</em> Infinity <em>which is not a float literal</em></span></td>
</tr>
<tr>
<td><a name="power"></a><a href="#power-note">power</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td> </td>
<td><span style="color: gray"><em>none</em></span></td>
<td>[Math]::pow(2, 32)</td>
</tr>
<tr>
<td><a name="sqrt"></a><a href="#sqrt-note">sqrt</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td> </td>
<td><span style="color: gray"><em>none</em></span></td>
<td>[Math]::sqrt(2)</td>
</tr>
<tr>
<td><a href="#sqrt-negative-two">sqrt -2</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>no sqrt</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>evaluates to</em> NaN <em>which is not a float literal</em></span></td>
</tr>
<tr>
<td><a href="#transcendental-func">transcendental functions</a></td>
<td>e l s c <span style="color: gray"><em>none</em></span> <span style="color: gray"><em>none</em></span> <span style="color: gray"><em>none</em></span> a <span style="color: gray"><em>none</em></span><br />
<span style="color: gray"><em>how to use:</em></span><br />
<span style="white-space: pre-wrap;">`</span>echo 'e(2)' | bc -l<span style="white-space: pre-wrap;">`</span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>[Math]::exp [Math]::log<br />
[Math]::sin [Math]::cos [Math]::tan<br />
[Math]::asin [Math]::acos [Math]::atan<br />
[Math]::atan2</td>
</tr>
<tr>
<td><a href="#float-truncation">float truncation</a><br />
<span style="color: gray"><em>round towards zero, round to nearest integer, round down, round up</em></span></td>
<td><span style="color: gray"><em>none and no floats</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>[Math]::truncate(3.14)<br />
[Math]::round(3.14)<br />
[Math]::floor(3.14)<br />
[Math]::ceiling(3.14)</td>
</tr>
<tr>
<td><a name="abs-val"></a><a href="#abs-val-note">absolute value</a><br />
<span style="color: gray"><em>and signum</em></span></td>
<td> </td>
<td><span style="color: gray"><em>none</em></span></td>
<td>[Math]::abs(-7)<br />
[Math]::sign(-7)</td>
</tr>
<tr>
<td><a href="#integer-overflow">integer overflow</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>modular arithmetic</em></span></td>
<td><span style="color: gray"><em>sometimes modular arithmetic; sometimes writes error message and sets %errorlevel% to nonzero value.</em></span></td>
<td><span style="color: gray"><em>converts to float</em></span></td>
</tr>
<tr>
<td><a href="#float-overflow">float overflow</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>no floats</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>evaluates to</em> Infinity <em>which is not a float literal</em></span></td>
</tr>
<tr>
<td><a href="#random">random integer, uniform float</a></td>
<td>echo $RANDOM <span style="color: gray"><em>15 bit integer</em></span></td>
<td><span style="color: gray">rem integer in range 0 to 32767:</span><br />
echo %random%</td>
<td>random 100<br />
random 1.0</td>
</tr>
<tr>
<td><a href="#seed-random">seed random numbers</a></td>
<td>RANDOM=17<br />
r=$RANDOM</td>
<td><span style="color: gray"><em>none</em></span></td>
<td>$r = random -setseed 17</td>
</tr>
<tr>
<td><a href="#bit-operators">bit operators</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="white-space: pre-wrap;"><< >> & | ^ ~</span></td>
<td><span style="color: gray"><em>use with</em> set /a:</span><br />
<span style="white-space: pre-wrap;"><< >> & | ^ ~</span></td>
<td><span style="color: gray"><em>none</em></span> <span style="color: gray"><em>none</em></span> -band -bor -bxor -bnot<br />
<br />
<span style="color: gray"># powershell 3.0:</span><br />
-lsl -lsr</td>
</tr>
<tr>
<th colspan="4"><a name="strings"></a><a href="#strings-note">strings</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a href="#string-literal">string literal</a></td>
<td>'don'\''t say "no"'<br />
"don't say \"no\""<br />
$'don\'t say "no"'</td>
<td><span style="color: gray"><em>None; barewords are used for strings.</em></span><br />
<br />
<span style="color: gray"><em>Double quotes are used for file names which contain spaces and other special characters. However, the double quotes are stored in the variables and passed to commands.</em></span></td>
<td>'don''t say "no"'<br />
"don't say <span style="white-space: pre-wrap;">`</span>"no<span style="white-space: pre-wrap;">`</span>""</td>
</tr>
<tr>
<td><a href="#string-literal-newline">newline in literal</a></td>
<td><span style="color: gray"><em>yes</em></span></td>
<td><span style="color: gray"><em>No; a bareword string can be continued on the following line by ending a line with ^; the CRLF is not part of the value of the string; it is not possible to store a CRLF in a variable.</em></span></td>
<td><span style="color: gray"><em>yes</em></span></td>
</tr>
<tr>
<td><a href="#barewords">barewords</a></td>
<td><span style="color: gray"><em>yes</em></span></td>
<td><span style="color: gray"><em>yes</em></span></td>
<td><span style="color: gray"><em>yes</em></span></td>
</tr>
<tr>
<td><a name="bareword-esc-char"></a><a href="#bareword-esc-char-note">bareword escape character</a></td>
<td><span style="color: gray"><em>backslash:</em></span> \;</td>
<td><span style="color: gray">//caret://</span> ^<<br />
<br />
<span style="color: gray"><em>Characters special to the interpreter can be stored in a variable by preceding them by a caret: ^; the interpreter will attempt to interpret them when the variable is dereferenced, however.</em></span></td>
<td>##gray|//backquote://: <span style="white-space: pre-wrap;">`</span>$</td>
</tr>
<tr>
<td><a href="#string-escapes">escapes</a></td>
<td><span style="color: gray"><em>in double quotes</em></span><br />
\\ \"<br />
<span style="color: gray"><em>in</em></span> $' ' <span style="color: gray"><em>quotes:</em></span><br />
\a \b \e \f \n \r \t \v \\ \' \c<span style="color: gray"><em>c</em></span> \x<span style="color: gray"><em>hh</em></span> \<span style="color: gray"><em>ooo</em></span></td>
<td> </td>
<td><span style="white-space: pre-wrap;">`</span>' <span style="white-space: pre-wrap;">`</span>" <span style="white-space: pre-wrap;">``</span><br />
<span style="white-space: pre-wrap;">`</span>0 <span style="white-space: pre-wrap;">`</span>a <span style="white-space: pre-wrap;">`</span>b <span style="white-space: pre-wrap;">`</span>f <span style="white-space: pre-wrap;">`</span>n <span style="white-space: pre-wrap;">`</span>r <span style="white-space: pre-wrap;">`</span>t <span style="white-space: pre-wrap;">`</span>v<br />
<span style="color: gray"><em>in other backtick sequences the backtick is ignored</em></span></td>
</tr>
<tr>
<td><a href="#variable-interpolation">variable interpolation</a></td>
<td>count=3<br />
item=ball<br />
"$count ${item}s"</td>
<td> </td>
<td>$count = 3<br />
$item = "ball"<br />
"$count $($item)s"</td>
</tr>
<tr>
<td><a href="#string-length">length</a></td>
<td>s="hello"<br />
${#s}</td>
<td><span style="color: gray"><em>see footnote</em></span></td>
<td>$s = "hello"<br />
$s.length</td>
</tr>
<tr>
<td><a href="#string-comparison">string comparison</a></td>
<td>[ $USER = foo ]<br />
[ $USER != foo ]</td>
<td> </td>
<td><span style="color: gray"># case insensitive:</span><br />
-eq -ne -gt -lt -ge -le<br />
<br />
<span style="color: gray"># case sensitive:</span><br />
-ceq -cne -cgt -clt -cge -cle</td>
</tr>
<tr>
<td><a href="#index-substring">index of substring</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td> </td>
<td><span style="color: gray"><em>returns -1 if not found:</em></span><br />
"foo bar".indexof("bar")</td>
</tr>
<tr>
<td><a href="#extract-substring">extract substring</a></td>
<td>s="foo bar"<br />
${s:4:3}</td>
<td>set s=foo bar<br />
echo %s:~4:3%</td>
<td>"foo bar".substring(4, 3)</td>
</tr>
<tr>
<td><a href="#string-concatenation">string concatenation</a></td>
<td>c="hello, ""world"</td>
<td><span style="color: gray">rem trailing whitespace is stored:</span><br />
set part1=hello,<span style="white-space: pre-wrap;"> </span> <br />
set part2=world<br />
echo %part1%%part2%</td>
<td>$c = "hello, " + "world"</td>
</tr>
<tr>
<td><a href="#string-replication">string replication</a></td>
<td> </td>
<td> </td>
<td>$hbar = "-" * 80</td>
</tr>
<tr>
<td><a href="#split">split</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td> </td>
<td>"foo,bar,baz" -split ","</td>
</tr>
<tr>
<td><a href="#join">join</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td> </td>
<td>@("foo","bar","baz") -join ","</td>
</tr>
<tr>
<td><a href="#sprintf">sprintf</a></td>
<td><span style="white-space: pre-wrap;">`</span>printf "tie: %s %d %f" "Spain" 13 3.7<span style="white-space: pre-wrap;">`</span></td>
<td> </td>
<td>$a = "Spain", 13, 3.7<br />
"tie: {0} {1} {2}" -f $a</td>
</tr>
<tr>
<td><a href="#case">case manipulation</a></td>
<td>echo "hello" | tr [a-z] [A-Z]<br />
echo "HELLO" | tr [A-Z] [a-z]<br />
A=hello<br />
echo -n ${A:0:1} | tr [a-z] [A-Z]; echo -n ${A:1}</td>
<td> </td>
<td>"hello".toupper()<br />
"HELLO".tolower()</td>
</tr>
<tr>
<td><a href="#strip">strip</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td> </td>
<td>" hello ".trim()</td>
</tr>
<tr>
<td><a href="#pad">pad on right, pad on left</a></td>
<td><span style="white-space: pre-wrap;">`</span>printf "%-10s" "hello"<span style="white-space: pre-wrap;">`</span><br />
<span style="white-space: pre-wrap;">`</span>printf "%10s" "hello"<span style="white-space: pre-wrap;">`</span></td>
<td> </td>
<td>$s = "hello"<br />
$s + " " * (10 - $s.length)<br />
" " * (10 - $s.length) + $s</td>
</tr>
<tr>
<td><a href="#string-to-number">string to number</a></td>
<td>A="12"<br />
$(( 7 + $A ))<br />
<br />
B=".037"<br />
<span style="white-space: pre-wrap;">`</span>echo 73.9 + $B | bc<span style="white-space: pre-wrap;">`</span></td>
<td>set x="12"<br />
set /a "result=7+%x%"</td>
<td>7 + "12"<br />
<br />
73.9 + ".037"</td>
</tr>
<tr>
<td><a href="#number-to-string">number to string</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>all values are strings</em></span></td>
<td><span style="color: gray"><em>all values are strings</em></span></td>
<td>[convert]::tostring(7) + " items"<br />
<br />
<span style="color: gray"># or use variable interpolation</span></td>
</tr>
<tr>
<th colspan="4"><a name="regexes"></a><a href="#regex-note">regular expressions</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="regex-match"></a><a href="#regex-match-note">regex match</a></td>
<td>s=hello<br />
rx='[a-z][a-z]*'<br />
if expr $s : $rx > /dev/null<br />
then<br />
<span style="white-space: pre-wrap;"> </span><span style="color: gray"><em>...</em></span><br />
fi</td>
<td>set s=hello<br />
echo %s%|findstr /r "[a-z][a-z]*" && (echo match ) ^<br />
<span style="white-space: pre-wrap;"> </span>@</td>
<td>@@ (echo does not match)</td>
<td>if ("hello" -match "^[a-z][a-z]*$") {<br />
<span style="white-space: pre-wrap;"> </span><span style="color: gray"><em>...</em></span><br />
}</td>
</tr>
<tr>
<td><a name="single-subst"></a><a href="#single-subst-note">single substitution</a></td>
<td>s='do re mi mi mi'<br />
s=$(echo $s | sed s/mi/ma/)</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><a name="global-subst"></a><a href="#global-subst-note">global substitution</a></td>
<td>s='do re mi mi mi'<br />
s=$(echo $s | sed s/mi/ma/g)</td>
<td>set "s=do re mi mi mi"<br />
echo %s:mi=ma%</td>
<td>$s = "do re mi mi mi"<br />
$s = $s -replace "mi", "ma"</td>
</tr>
<tr>
<th colspan="4"><a name="dates-time"></a><a href="#dates-time-note">dates and time</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="current-datetime"></a><a href="#current-datetime-note">current datetime</a></td>
<td>date +'%Y-%m-%d %H:%M:%S'</td>
<td>date /t && time /t</td>
<td>get-date -format 'yyyy-MM-dd HH:mm:ss'<br />
get-date -uformat '%Y-%m-%d %H:%M:%S'</td>
</tr>
<tr>
<td><a name="current-unix-epoch"></a><a href="#current-unix-epoch-note">current unix epoch</a></td>
<td>date +'%s'</td>
<td> </td>
<td>get-date -uformat %s</td>
</tr>
<tr>
<td><a name="fmt-datetime"></a><a href="#fmt-datetime-note">format datetime</a></td>
<td>date -d '1970-01-01 00:00:00 UTC' +'%s'</td>
<td> </td>
<td>get-date -date '1970-01-01 00:00:00' -uformat %s</td>
</tr>
<tr>
<th colspan="4"><a name="arrays"></a><a href="#arrays-note">arrays</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="resizable-array-literal"></a><a href="#resizable-array-literal-note">literal</a></td>
<td>nums=(1 2 3 4)</td>
<td>set nums=(1 2 3 4)</td>
<td>$nums = 1 ,2 ,3, 4<br />
$nums = @(1 ,2, 3, 4)</td>
</tr>
<tr>
<td><a name="resizable-array-size"></a><a href="#resizable-array-size-note">size</a></td>
<td>${#nums[@]}</td>
<td>set numsc=0<br />
for %i in %nums% do set /a numsc+=1<br />
echo %numsc%</td>
<td>$nums.Length</td>
</tr>
<tr>
<td><a name="resizable-array-lookup"></a><a href="#resizable-array-lookup-note">lookup</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>${nums[0]}</td>
<td> </td>
<td>$nums[0]</td>
</tr>
<tr>
<td><a name="resizable-array-update"></a><a href="#resizable-array-update-note">update</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>nums[1]=5</td>
<td> </td>
<td>$nums[0] = 5</td>
</tr>
<tr>
<td><a href="#array-slice">slice</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>${nums[@]:1:2}</td>
<td> </td>
<td>$nums[1..2]</td>
</tr>
<tr>
<td><a href="#array-concatenation">concatenate</a></td>
<td>a=(1 2 3)<br />
b=(4 5 6)<br />
c=(${a[@]} ${b[@]})</td>
<td> </td>
<td>@(1, 2, 3) + @(4, 5, 6)</td>
</tr>
<tr>
<td><a href="#array-iteration">iterate over elements</a></td>
<td>for i in ${nums[@]}<br />
do echo $i<br />
done</td>
<td> </td>
<td>foreach ($i in $nums) {<br />
<span style="white-space: pre-wrap;"> </span>write-output $i<br />
}</td>
</tr>
<tr>
<td><a href="#array-sort">sort</a></td>
<td> </td>
<td> </td>
<td>$a = 3, 2, 4, 1<br />
$b = $a | Sort-Object</td>
</tr>
<tr>
<td><a href="#array-reverse">reverse</a></td>
<td> </td>
<td> </td>
<td>$a = 1, 2, 3<br />
[array]::reverse($a)</td>
</tr>
<tr>
<th colspan="4"><a name="functions"></a><a href="#functions-note">functions</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="def-func"></a><a href="#def-func-note">define</a></td>
<td>add() { echo $(( $1 + $2 )); }<br />
<span style="color: gray"><em>or</em></span><br />
function add { echo $(( $1 + $2 )); }</td>
<td>goto:eof<br />
:add<br />
<span style="white-space: pre-wrap;"> </span>set /a sum=%~1+%~2<br />
<span style="white-space: pre-wrap;"> </span>echo %sum%<br />
goto:eof</td>
<td>function add {<br />
<span style="white-space: pre-wrap;"> </span>param ($a, $b)<br />
<span style="white-space: pre-wrap;"> </span>$a + $b<br />
}</td>
</tr>
<tr>
<td><a name="call-func"></a><a href="#call-func-note">call</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>add 1 2</td>
<td>call:add 1 2</td>
<td>add 1 2</td>
</tr>
<tr>
<td><a name="missing-arg"></a><a href="#missing-arg-note">missing argument behavior</a></td>
<td>''</td>
<td><span style="color: gray"><em>parameter treated as undefined variable or as containing the empty string</em></span></td>
<td>$null</td>
</tr>
<tr>
<td><a name="extra-arg"></a><a href="#extra-arg-note">extra argument behavior</a></td>
<td><span style="color: gray"><em>ignored</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>ignored</em></span></td>
</tr>
<tr>
<td><a name="default-arg"></a><a href="#default-arg-note">default argument</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>function add {<br />
<span style="white-space: pre-wrap;"> </span>param ($a=0, $b=0)<br />
<span style="white-space: pre-wrap;"> </span>$a + $b<br />
}</td>
</tr>
<tr>
<td><a name="named-param"></a><a href="#named-param-note">named parameters</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>add -a 1 -b 2</td>
</tr>
<tr>
<td><a name="retval"></a><a href="#retval-note">return value</a></td>
<td>return <span style="color: gray"><em>arg available in</em></span> $? <span style="color: gray"><em>variable if a positive integer smaller than 256</em></span></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><a name="anon-func-literal"></a><a href="#anon-func-literal-note">anonymous function literal</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>$f = { write-output "foo" }</td>
</tr>
<tr>
<td><a name="call-anon-func"></a><a href="#call-anon-func-note">call anonymous function</a></td>
<td><span style="color: gray"><em>none</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>& $f<br />
<span style="color: gray"><em>or</em></span><br />
$x.invoke()</td>
</tr>
<tr>
<td><a href="#default-scope">default scope</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td><span style="color: gray"><em>global</em></span></td>
<td><span style="color: gray"><em>global</em></span></td>
<td><span style="color: gray"><em>local</em></span></td>
</tr>
<tr>
<td><a name="nest-func"></a><a href="#nest-func-note">nest</a></td>
<td><span style="color: gray"><em>Nested function visible outside containing function.</em></span></td>
<td><span style="color: gray"><em>none</em></span></td>
<td>function add {<br />
<span style="white-space: pre-wrap;"> </span>param ($a, $b)<br />
<span style="white-space: pre-wrap;"> </span>function add2 {<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>param ($a2, $b2)<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>$a2 + $b2<br />
<span style="white-space: pre-wrap;"> </span>}<br />
<span style="white-space: pre-wrap;"> </span>add2 $a $b<br />
}<br />
<br />
<span style="color: gray"># Nested function not visible outside of containing<br />
# function; nested function can see local variables<br />
# of containing function.</span></td>
</tr>
<tr>
<th colspan="4"><a name="execution-control"></a><a href="#execution-control-note">execution control</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="if"></a><a href="#if-note">if</a></td>
<td>if [ $n -eq 0 ]<br />
then<br />
<span style="white-space: pre-wrap;"> </span>echo "no hits"<br />
elif [ $n -eq 1 ]<br />
then<br />
<span style="white-space: pre-wrap;"> </span>echo "1 hit"<br />
else<br />
<span style="white-space: pre-wrap;"> </span>echo $n " hits"<br />
fi</td>
<td>if %n% equ 0 (<br />
<span style="white-space: pre-wrap;"> </span>echo no hits<br />
) else (<br />
<span style="white-space: pre-wrap;"> </span>if %n% equ 1 (<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>echo one hit<br />
<span style="white-space: pre-wrap;"> </span>) else (<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>echo %n% hits<br />
<span style="white-space: pre-wrap;"> </span>)<br />
)</td>
<td>if ($n -eq 0) {<br />
<span style="white-space: pre-wrap;"> </span>write-output "no hits"<br />
} elseif ($n -eq 1) {<br />
<span style="white-space: pre-wrap;"> </span>write-output "one hit"<br />
} else {<br />
<span style="white-space: pre-wrap;"> </span>write-output "$n hits"<br />
}</td>
</tr>
<tr>
<td><a name="while"></a><a href="#while-note">while</a></td>
<td>i=0<br />
while [ $i -lt 10 ]<br />
do i=$(($i + 1))<br />
<span style="white-space: pre-wrap;"> </span>echo $i<br />
done</td>
<td>set i=0<br />
:loop<br />
<span style="white-space: pre-wrap;"> </span>set /a i+=1<br />
<span style="white-space: pre-wrap;"> </span>echo %i%<br />
if %i% lss 10 goto :loop</td>
<td>$i = 0<br />
while ($i -lt 10) {<br />
<span style="white-space: pre-wrap;"> </span>write-output (++$i)<br />
}</td>
</tr>
<tr>
<td><a name="for"></a><a href="#for-note">for</a></td>
<td>for i in 1 2 3<br />
do<br />
<span style="white-space: pre-wrap;"> </span>echo $i<br />
done</td>
<td>set nums=(1 2 3 4)<br />
for %%n in %nums% do echo %%n</td>
<td>for ($i=1; $i -le 3; $i++) {<br />
<span style="white-space: pre-wrap;"> </span>write-output $i<br />
}</td>
</tr>
<tr>
<td><a name="break"></a><a href="#break-note">break</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>break</td>
<td> </td>
<td>break</td>
</tr>
<tr>
<td><a name="continue"></a><a href="#continue-note">continue</a><br />
<span style="white-space: pre-wrap;"> </span></td>
<td>continue</td>
<td> </td>
<td>continue</td>
</tr>
<tr>
<th colspan="4"><a name="exceptions"></a><a href="#exceptions-note">exceptions</a></th>
</tr>
<tr>
<th></th>
<th><a href="#posix">posix shell</a></th>
<th><a href="#cmd-prompt">cmd.exe</a></th>
<th><a href="#powershell">powershell</a></th>
</tr>
<tr>
<td><a name="raise-exc"></a><a href="#raise-exc-note">raise</a></td>
<td><span style="color: gray"><em>Commands which fail return nonzero exit status.<br />
<br />
Exit status of last command stored in $?</em></span></td>
<td><span style="color: gray"><em>Commands which fail return nonzero exit status.<br />
<br />
Exit status of last command stored in %errorlevel%</em></span></td>
<td>throw "bam!"</td>
</tr>
<tr>
<td><a name="handle-exc"></a><a href="#handle-exc-note">handle</a></td>
<td>trap 'echo "risky failed"' ERR<br />
risky</td>
<td>risky<br />
<br />
if errorlevel 1 (<br />
<span style="white-space: pre-wrap;"> </span>echo risky failed<br />
)</td>
<td>try {<br />
<span style="white-space: pre-wrap;"> </span>throw "bam!"<br />
}<br />
catch {<br />
<span style="white-space: pre-wrap;"> </span>write-output "caught!"<br />
}</td>
</tr>
<tr>
<td><a name="uncaught-exc"></a><a href="#uncaught-exc-note">uncaught exception behavior</a></td>
<td><span style="color: gray"><em>stderr and continue</em></span></td>
<td><span style="color: gray"><em>stderr and continue</em></span></td>
<td><span style="color: gray"><em>script exits</em></span></td>
</tr>
<tr>