source: rtems-docs/shell/general_commands.rst @ df77336

4.115
Last change on this file since df77336 was df77336, checked in by Chris Johns <chrisj@…>, on 01/22/16 at 23:14:42

Add links from the command list to the commands.

  • Property mode set to 100644
File size: 27.2 KB
Line 
1.. COMMENT: COPYRIGHT (c) 1988-2008.
2.. COMMENT: On-Line Applications Research Corporation (OAR).
3.. COMMENT: All rights reserved.
4
5General Commands
6################
7
8Introduction
9============
10
11The RTEMS shell has the following general commands:
12
13- help_ - Print command help
14
15- alias_ - Add alias for an existing command
16
17- cmdls_ - List commands
18
19- cmdchown_ - Change user or owner of commands
20
21- cmdchmod_ - Change mode of commands
22
23- date_ - Print or set current date and time
24
25- echo_ - Produce message in a shell script
26
27- sleep_ - Delay for a specified amount of time
28
29- id_ - show uid gid euid and egid
30
31- tty_ - show ttyname
32
33- whoami_ - print effective user id
34
35- getenv_ - print environment variable
36
37- setenv_ - set environment variable
38
39- unsetenv_ - unset environment variable
40
41- time_ - time command execution
42
43- logoff_ - logoff from the system
44
45- rtc_ - RTC driver configuration
46
47- exit_ - alias for logoff command
48
49Commands
50========
51
52This section details the General Commands available.  A subsection is dedicated
53to each of the commands and describes the behavior and configuration of that
54command as well as providing an example usage.
55
56.. _help:
57
58help - Print command help
59-------------------------
60.. index:: help
61
62**SYNOPSYS:**
63
64.. code:: shell
65
66    help misc
67
68**DESCRIPTION:**
69
70This command prints the command help. Help without arguments prints a list of
71topics and help with a topic prints the help for that topic.
72
73**EXIT STATUS:**
74
75This command returns 0.
76
77**NOTES:**
78
79The help print will break the output up based on the environment variable
80SHELL_LINES. If this environment variable is not set the default is 16
81lines. If set the number of lines is set to that the value. If the shell lines
82is set 0 there will be no break.
83
84**EXAMPLES:**
85
86The following is an example of how to use ``alias``:
87
88.. code:: shell
89
90    SHLL [/] $ help
91    help: ('r' repeat last cmd - 'e' edit last cmd)
92    TOPIC? The topics are
93    mem, misc, files, help, rtems, network, monitor
94    SHLL [/] $ help misc
95    help: list for the topic 'misc'
96    alias        - alias old new
97    time         - time command [arguments...]
98    joel         - joel [args] SCRIPT
99    date         - date [YYYY-MM-DD HH:MM:SS]
100    echo         - echo [args]
101    sleep        - sleep seconds [nanoseconds]
102    id           - show uid, gid, euid, and egid
103    tty          - show ttyname
104    whoami       - show current user
105    logoff       - logoff from the system
106    setenv       - setenv [var] [string]
107    getenv       - getenv [var]
108    unsetenv     - unsetenv [var]
109    umask        - umask [new_umask]
110    Press any key to continue...
111    rtc          - real time clock read and set
112    SHLL [/] $ setenv SHELL_ENV 0
113    SHLL [/] $ help misc
114    help: list for the topic 'misc'
115    alias        - alias old new
116    time         - time command [arguments...]
117    joel         - joel [args] SCRIPT
118    date         - date [YYYY-MM-DD HH:MM:SS]
119    echo         - echo [args]
120    sleep        - sleep seconds [nanoseconds]
121    id           - show uid, gid, euid, and egid
122    tty          - show ttyname
123    whoami       - show current user
124    logoff       - logoff from the system
125    setenv       - setenv [var] [string]
126    getenv       - getenv [var]
127    unsetenv     - unsetenv [var]
128    umask        - umask [new_umask]
129    rtc          - real time clock read and set
130
131**CONFIGURATION:**
132
133This command has no configuration.
134
135.. _alias:
136
137alias - add alias for an existing command
138-----------------------------------------
139.. index:: alias
140
141**SYNOPSYS:**
142
143.. code:: shell
144
145    alias oldCommand newCommand
146
147**DESCRIPTION:**
148
149This command adds an alternate name for an existing command to the command set.
150
151**EXIT STATUS:**
152
153This command returns 0 on success and non-zero if an error is encountered.
154
155**NOTES:**
156
157None.
158
159**EXAMPLES:**
160
161The following is an example of how to use ``alias``:
162
163.. code:: shell
164
165    SHLL [/] $ me
166    shell:me command not found
167    SHLL [/] $ alias whoami me
168    SHLL [/] $ me
169    rtems
170    SHLL [/] $ whoami
171    rtems
172
173**CONFIGURATION:**
174
175.. index:: CONFIGURE_SHELL_NO_COMMAND_ALIAS
176.. index:: CONFIGURE_SHELL_COMMAND_ALIAS
177
178This command is included in the default shell command set.  When building a
179custom command set, define ``CONFIGURE_SHELL_COMMAND_ALIAS`` to have this
180command included.
181
182This command can be excluded from the shell command set by defining
183``CONFIGURE_SHELL_NO_COMMAND_ALIAS`` when all shell commands have been
184configured.
185
186**PROGRAMMING INFORMATION:**
187
188.. index:: rtems_shell_rtems_main_alias
189
190The ``alias`` is implemented by a C language function which has the following
191prototype:
192
193.. code:: c
194
195    int rtems_shell_rtems_main_alias(
196        int    argc,
197        char **argv
198    );
199
200The configuration structure for the ``alias`` has the following prototype:
201
202.. code:: c
203
204    extern rtems_shell_cmd_t rtems_shell_ALIAS_Command;
205
206.. _cmdls:
207
208cmdls - List commands
209---------------------
210.. index:: cmdls
211
212**SYNOPSYS:**
213
214.. code:: shell
215
216    cmdls COMMAND...
217
218**DESCRIPTION:**
219
220This command lists the visible commands of the command set.
221
222**EXIT STATUS:**
223
224This command returns 0 on success and non-zero if an error is encountered.
225
226**NOTES:**
227
228The current user must have read permission to list a command.
229
230**EXAMPLES:**
231
232The following is an example of how to use ``cmdls``:
233
234.. code:: shell
235
236    SHLL [/] # cmdls help shutdown
237    r-xr-xr-x     0     0 help
238    r-x------     0     0 shutdown
239
240**CONFIGURATION:**
241
242.. index:: CONFIGURE_SHELL_NO_COMMAND_CMDLS
243.. index:: CONFIGURE_SHELL_COMMAND_CMDLS
244
245This command is included in the default shell command set.  When building a
246custom command set, define ``CONFIGURE_SHELL_COMMAND_CMDLS`` to have this
247command included.
248
249This command can be excluded from the shell command set by defining
250``CONFIGURE_SHELL_NO_COMMAND_CMDLS`` when all shell commands have been
251configured.
252
253**PROGRAMMING INFORMATION:**
254
255The configuration structure for the ``cmdls`` has the following prototype:
256
257.. code:: c
258
259    extern rtems_shell_cmd_t rtems_shell_CMDLS_Command;
260
261.. _cmdchown:
262
263cmdchown - Change user or owner of commands
264-------------------------------------------
265.. index:: cmdchown
266
267**SYNOPSYS:**
268
269.. code:: shell
270
271    cmdchown [OWNER][:[GROUP]] COMMAND...
272
273**DESCRIPTION:**
274
275This command changes the user or owner of a command.
276
277**EXIT STATUS:**
278
279This command returns 0 on success and non-zero if an error is encountered.
280
281**NOTES:**
282
283The current user must have an UID of zero or be the command owner to change the
284owner or group.
285
286**EXAMPLES:**
287
288The following is an example of how to use ``cmdchown``:
289
290.. code:: shell
291
292    [/] # cmdls help
293    r-xr-xr-x     0     0 help
294    [/] # cmdchown 1:1 help
295    [/] # cmdls help
296    r--r--r--     1     1 help
297
298**CONFIGURATION:**
299
300.. index:: CONFIGURE_SHELL_NO_COMMAND_CMDCHOWN
301.. index:: CONFIGURE_SHELL_COMMAND_CMDCHOWN
302
303This command is included in the default shell command set.  When building a
304custom command set, define ``CONFIGURE_SHELL_COMMAND_CMDCHOWN`` to have this
305command included.
306
307This command can be excluded from the shell command set by defining
308``CONFIGURE_SHELL_NO_COMMAND_CMDCHOWN`` when all shell commands have been
309configured.
310
311**PROGRAMMING INFORMATION:**
312
313The configuration structure for the ``cmdchown`` has the following prototype:
314
315.. code:: c
316
317    extern rtems_shell_cmd_t rtems_shell_CMDCHOWN_Command;
318
319.. _cmdchmod:
320
321cmdchmod - Change mode of commands
322----------------------------------
323.. index:: cmdchmod
324
325**SYNOPSYS:**
326
327.. code:: shell
328
329    cmdchmod OCTAL-MODE COMMAND...
330
331**DESCRIPTION:**
332
333This command changes the mode of a command.
334
335**EXIT STATUS:**
336
337This command returns 0 on success and non-zero if an error is encountered.
338
339**NOTES:**
340
341The current user must have an UID of zero or be the command owner to change the
342mode.
343
344**EXAMPLES:**
345
346The following is an example of how to use ``cmdchmod``:
347
348.. code:: shell
349
350    [/] # cmdls help
351    r-xr-xr-x     0     0 help
352    [/] # cmdchmod 544 help
353    [/] # cmdls help
354    r-xr--r--     0     0 help
355
356**CONFIGURATION:**
357
358.. index:: CONFIGURE_SHELL_NO_COMMAND_CMDCHMOD
359.. index:: CONFIGURE_SHELL_COMMAND_CMDCHMOD
360
361This command is included in the default shell command set.  When building a
362custom command set, define ``CONFIGURE_SHELL_COMMAND_CMDCHMOD`` to have this
363command included.
364
365This command can be excluded from the shell command set by defining
366``CONFIGURE_SHELL_NO_COMMAND_CMDCHMOD`` when all shell commands have been
367configured.
368
369**PROGRAMMING INFORMATION:**
370
371The configuration structure for the ``cmdchmod`` has the following prototype:
372
373.. code:: c
374
375    extern rtems_shell_cmd_t rtems_shell_CMDCHMOD_Command;
376
377.. _date:
378
379date - print or set current date and time
380-----------------------------------------
381.. index:: date
382
383**SYNOPSYS:**
384
385.. code:: shell
386
387    date
388    date DATE TIME
389
390**DESCRIPTION:**
391
392This command operates one of two modes.  When invoked with no arguments, it
393prints the current date and time.  When invoked with both ``date`` and ``time``
394arguments, it sets the current time.
395
396The ``date`` is specified in ``YYYY-MM-DD`` format.
397The ``time`` is specified in ``HH:MM:SS`` format.
398
399**EXIT STATUS:**
400
401This command returns 0 on success and non-zero if an error is encountered.
402
403**NOTES:**
404
405None.
406
407**EXAMPLES:**
408
409The following is an example of how to use ``date``:
410
411.. code:: shell
412
413    SHLL [/] $ date
414    Fri Jan  1 00:00:09 1988
415    SHLL [/] $ date 2008-02-29 06:45:32
416    SHLL [/] $ date
417    Fri Feb 29 06:45:35 2008
418
419**CONFIGURATION:**
420
421.. index:: CONFIGURE_SHELL_NO_COMMAND_DATE
422.. index:: CONFIGURE_SHELL_COMMAND_DATE
423
424This command is included in the default shell command set.  When building a
425custom command set, define ``CONFIGURE_SHELL_COMMAND_DATE`` to have this command
426included.
427
428This command can be excluded from the shell command set by defining
429``CONFIGURE_SHELL_NO_COMMAND_DATE`` when all shell commands have been
430configured.
431
432**PROGRAMMING INFORMATION:**
433
434.. index:: rtems_shell_rtems_main_date
435
436The ``date`` is implemented by a C language function which has the following
437prototype:
438
439.. code:: c
440
441    int rtems_shell_rtems_main_date(
442        int    argc,
443        char **argv
444    );
445
446The configuration structure for the ``date`` has the following prototype:
447
448.. code:: c
449
450    extern rtems_shell_cmd_t rtems_shell_DATE_Command;
451
452.. _echo:
453
454echo - produce message in a shell script
455----------------------------------------
456.. index:: echo
457
458**SYNOPSYS:**
459
460.. code:: shell
461
462    echo [-n | -e] args ...
463
464**DESCRIPTION:**
465
466Echo prints its arguments on the standard output, separated by spaces.  Unless
467the *-n* option is present, a newline is output following the arguments.  The
468*-e* option causes echo to treat the escape sequences specially, as described
469in the following paragraph.  The *-e* option is the default, and is provided
470solely for compatibility with other systems.  Only one of the options *-n* and
471*-e* may be given.
472
473If any of the following sequences of characters is encountered during output,
474the sequence is not output.  Instead, the specified action is performed:
475
476*\\b*
477    A backspace character is output.
478
479*\\c*
480    Subsequent output is suppressed.  This is normally used at the end of the
481    last argument to suppress the trailing newline that echo would otherwise
482    output.
483
484*\\f*
485    Output a form feed.
486
487*\\n*
488    Output a newline character.
489
490*\\r*
491    Output a carriage return.
492
493*\\t*
494    Output a (horizontal) tab character.
495
496*\\v*
497    Output a vertical tab.
498
499*\\0digits*
500    Output the character whose value is given by zero to three digits.  If
501    there are zero digits, a nul character is output.
502
503*\\\\*
504    Output a backslash.
505
506**EXIT STATUS:**
507
508This command returns 0 on success and non-zero if an error is encountered.
509
510**NOTES:**
511
512The octal character escape mechanism (\\0digits) differs from the C language
513mechanism.
514
515There is no way to force ``echo`` to treat its arguments literally, rather than
516interpreting them as options and escape sequences.
517
518**EXAMPLES:**
519
520The following is an example of how to use ``echo``:
521
522.. code:: shell
523
524    SHLL [/] $ echo a b c
525    a b c
526    SHLL [/] $ echo
527
528**CONFIGURATION:**
529
530.. index:: CONFIGURE_SHELL_NO_COMMAND_ECHO
531.. index:: CONFIGURE_SHELL_COMMAND_ECHO
532
533This command is included in the default shell command set.  When building a
534custom command set, define ``CONFIGURE_SHELL_COMMAND_ECHO`` to have this command
535included.
536
537This command can be excluded from the shell command set by defining
538``CONFIGURE_SHELL_NO_COMMAND_ECHO`` when all shell commands have been
539configured.
540
541**PROGRAMMING INFORMATION:**
542
543.. index:: rtems_shell_rtems_main_echo
544
545The ``echo`` is implemented by a C language function which has the following
546prototype:
547
548.. code:: c
549
550    int rtems_shell_rtems_main_echo(
551        int    argc,
552        char **argv
553    );
554
555The configuration structure for the ``echo`` has the following prototype:
556
557.. code:: c
558
559    extern rtems_shell_cmd_t rtems_shell_ECHO_Command;
560
561**ORIGIN:**
562
563The implementation and portions of the documentation for this command are from
564NetBSD 4.0.
565
566.. _sleep:
567
568sleep - delay for a specified amount of time
569--------------------------------------------
570.. index:: sleep
571
572**SYNOPSYS:**
573
574.. code:: shell
575
576    sleep seconds
577    sleep seconds nanoseconds
578
579**DESCRIPTION:**
580
581This command causes the task executing the shell to block for the specified
582number of ``seconds`` and ``nanoseconds``.
583
584**EXIT STATUS:**
585
586This command returns 0 on success and non-zero if an error is encountered.
587
588**NOTES:**
589
590This command is implemented using the ``nanosleep()`` method.
591
592The command line interface is similar to the ``sleep`` command found on POSIX
593systems but the addition of the ``nanoseconds`` parameter allows fine grained
594delays in shell scripts without adding another command such as ``usleep``.
595
596**EXAMPLES:**
597
598The following is an example of how to use ``sleep``:
599
600.. code:: shell
601
602    SHLL [/] $ sleep 10
603    SHLL [/] $ sleep 0 5000000
604
605It is not clear from the above but there is a ten second pause after executing
606the first command before the prompt is printed.  The second command completes
607very quickly from a human perspective and there is no noticeable delay in the
608prompt being printed.
609
610**CONFIGURATION:**
611
612.. index:: CONFIGURE_SHELL_NO_COMMAND_SLEEP
613.. index:: CONFIGURE_SHELL_COMMAND_SLEEP
614
615This command is included in the default shell command set.  When building a
616custom command set, define ``CONFIGURE_SHELL_COMMAND_SLEEP`` to have this
617command included.
618
619This command can be excluded from the shell command set by defining
620``CONFIGURE_SHELL_NO_COMMAND_SLEEP`` when all shell commands have been
621configured.
622
623**PROGRAMMING INFORMATION:**
624
625.. index:: rtems_shell_rtems_main_sleep
626
627The ``sleep`` is implemented by a C language function which has the following
628prototype:
629
630.. code:: c
631
632    int rtems_shell_rtems_main_sleep(
633        int    argc,
634        char **argv
635    );
636
637The configuration structure for the ``sleep`` has the following prototype:
638
639.. code:: c
640
641    extern rtems_shell_cmd_t rtems_shell_SLEEP_Command;
642
643.. _id:
644
645id - show uid gid euid and egid
646-------------------------------
647.. index:: id
648
649**SYNOPSYS:**
650
651.. code:: shell
652
653    id
654
655**DESCRIPTION:**
656
657This command prints the user identity.  This includes the user id (uid), group
658id (gid), effective user id (euid), and effective group id (egid).
659
660**EXIT STATUS:**
661
662This command returns 0 on success and non-zero if an error is encountered.
663
664**NOTES:**
665
666Remember there is only one POSIX process in a single processor RTEMS
667application. Each thread may have its own user identity and that identity is
668used by the filesystem to enforce permissions.
669
670**EXAMPLES:**
671
672The first example of the ``id`` command is from a session logged
673in as the normal user ``rtems``:
674
675.. code:: shell
676
677    SHLL [/] # id
678    uid=1(rtems),gid=1(rtems),euid=1(rtems),egid=1(rtems)
679
680The second example of the ``id`` command is from a session logged in as the
681``root`` user:
682
683.. code:: shell
684
685    SHLL [/] # id
686    uid=0(root),gid=0(root),euid=0(root),egid=0(root)
687
688**CONFIGURATION:**
689
690.. index:: CONFIGURE_SHELL_NO_COMMAND_ID
691.. index:: CONFIGURE_SHELL_COMMAND_ID
692
693This command is included in the default shell command set.  When building a
694custom command set, define ``CONFIGURE_SHELL_COMMAND_ID`` to have this command
695included.
696
697This command can be excluded from the shell command set by defining
698``CONFIGURE_SHELL_NO_COMMAND_ID`` when all shell commands have been configured.
699
700**PROGRAMMING INFORMATION:**
701
702.. index:: rtems_shell_rtems_main_id
703
704The ``id`` is implemented by a C language function which has the following
705prototype:
706
707.. code:: c
708
709    int rtems_shell_rtems_main_id(
710        int    argc,
711        char **argv
712    );
713
714The configuration structure for the ``id`` has the following prototype:
715
716.. code:: c
717
718    extern rtems_shell_cmd_t rtems_shell_ID_Command;
719
720.. _tty:
721
722tty - show ttyname
723------------------
724.. index:: tty
725
726**SYNOPSYS:**
727
728.. code:: shell
729
730    tty
731
732**DESCRIPTION:**
733
734This command prints the file name of the device connected to standard input.
735
736**EXIT STATUS:**
737
738This command returns 0 on success and non-zero if an error is encountered.
739
740**NOTES:**
741
742NONE
743
744**EXAMPLES:**
745
746The following is an example of how to use ``tty``:
747
748.. code:: shell
749
750    SHLL [/] $ tty
751    /dev/console
752
753**CONFIGURATION:**
754
755.. index:: CONFIGURE_SHELL_NO_COMMAND_TTY
756.. index:: CONFIGURE_SHELL_COMMAND_TTY
757
758This command is included in the default shell command set.  When building a
759custom command set, define ``CONFIGURE_SHELL_COMMAND_TTY`` to have this command
760included.
761
762This command can be excluded from the shell command set by defining
763``CONFIGURE_SHELL_NO_COMMAND_TTY`` when all shell commands have been
764configured.
765
766**PROGRAMMING INFORMATION:**
767
768.. index:: rtems_shell_rtems_main_tty
769
770The ``tty`` is implemented by a C language function which has the following
771prototype:
772
773.. code:: c
774
775    int rtems_shell_rtems_main_tty(
776        int    argc,
777        char **argv
778    );
779
780The configuration structure for the ``tty`` has the following prototype:
781
782.. code:: c
783
784    extern rtems_shell_cmd_t rtems_shell_TTY_Command;
785
786.. _whoami:
787
788whoami - print effective user id
789--------------------------------
790.. index:: whoami
791
792**SYNOPSYS:**
793
794.. code:: shell
795
796    whoami
797
798**DESCRIPTION:**
799
800This command displays the user name associated with the current effective user
801id.
802
803**EXIT STATUS:**
804
805This command always succeeds.
806
807**NOTES:**
808
809None.
810
811**EXAMPLES:**
812
813The following is an example of how to use ``whoami``:
814
815.. code:: shell
816
817    SHLL [/] $ whoami
818    rtems
819
820**CONFIGURATION:**
821
822.. index:: CONFIGURE_SHELL_NO_COMMAND_WHOAMI
823.. index:: CONFIGURE_SHELL_COMMAND_WHOAMI
824
825This command is included in the default shell command set.  When building a
826custom command set, define ``CONFIGURE_SHELL_COMMAND_WHOAMI`` to have this
827command included.
828
829This command can be excluded from the shell command set by defining
830``CONFIGURE_SHELL_NO_COMMAND_WHOAMI`` when all shell commands have been
831configured.
832
833**PROGRAMMING INFORMATION:**
834
835.. index:: rtems_shell_rtems_main_whoami
836
837The ``whoami`` is implemented by a C language function which has the following
838prototype:
839
840.. code:: c
841
842    int rtems_shell_rtems_main_whoami(
843        int    argc,
844        char **argv
845    );
846
847The configuration structure for the ``whoami`` has the following prototype:
848
849.. code:: c
850
851    extern rtems_shell_cmd_t rtems_shell_WHOAMI_Command;
852
853.. _getenv:
854
855getenv - print environment variable
856-----------------------------------
857.. index:: getenv
858
859**SYNOPSYS:**
860
861.. code:: shell
862
863    getenv variable
864
865**DESCRIPTION:**
866
867This command is used to display the value of a ``variable`` in the set of
868environment variables.
869
870**EXIT STATUS:**
871
872This command will return 1 and print a diagnostic message if a failure occurs.
873
874**NOTES:**
875
876The entire RTEMS application shares a single set of environment variables.
877
878**EXAMPLES:**
879
880The following is an example of how to use ``getenv``:
881
882.. code:: shell
883
884    SHLL [/] $ getenv BASEPATH
885    /mnt/hda1
886
887**CONFIGURATION:**
888
889.. index:: CONFIGURE_SHELL_NO_COMMAND_GETENV
890.. index:: CONFIGURE_SHELL_COMMAND_GETENV
891
892This command is included in the default shell command set.  When building a
893custom command set, define ``CONFIGURE_SHELL_COMMAND_GETENV`` to have this
894command included.
895
896This command can be excluded from the shell command set by defining
897``CONFIGURE_SHELL_NO_COMMAND_GETENV`` when all shell commands have been
898configured.
899
900**PROGRAMMING INFORMATION:**
901
902.. index:: rtems_shell_rtems_main_getenv
903
904The ``getenv`` is implemented by a C language function which has the following
905prototype:
906
907.. code:: c
908
909    int rtems_shell_rtems_main_getenv(
910        int    argc,
911        char **argv
912    );
913
914The configuration structure for the ``getenv`` has the following prototype:
915
916.. code:: c
917
918    extern rtems_shell_cmd_t rtems_shell_GETENV_Command;
919
920.. _setenv:
921
922setenv - set environment variable
923---------------------------------
924.. index:: setenv
925
926**SYNOPSYS:**
927
928.. code:: shell
929
930    setenv variable [value]
931
932**DESCRIPTION:**
933
934This command is used to add a new ``variable`` to the set of environment
935variables or to modify the variable of an already existing ``variable``.  If
936the ``value`` is not provided, the ``variable`` will be set to the empty
937string.
938
939**EXIT STATUS:**
940
941This command will return 1 and print a diagnostic message if a failure occurs.
942
943**NOTES:**
944
945The entire RTEMS application shares a single set of environment variables.
946
947**EXAMPLES:**
948
949The following is an example of how to use ``setenv``:
950
951.. code:: shell
952
953    SHLL [/] $ setenv BASEPATH /mnt/hda1
954
955**CONFIGURATION:**
956
957.. index:: CONFIGURE_SHELL_NO_COMMAND_SETENV
958.. index:: CONFIGURE_SHELL_COMMAND_SETENV
959
960This command is included in the default shell command set.  When building a
961custom command set, define ``CONFIGURE_SHELL_COMMAND_SETENV`` to have this
962command included.
963
964This command can be excluded from the shell command set by defining
965``CONFIGURE_SHELL_NO_COMMAND_SETENV`` when all shell commands have been
966configured.
967
968**PROGRAMMING INFORMATION:**
969
970.. index:: rtems_shell_rtems_main_setenv
971
972The ``setenv`` is implemented by a C language function which has the following
973prototype:
974
975.. code:: c
976
977    int rtems_shell_rtems_main_setenv(
978        int    argc,
979        char **argv
980    );
981
982The configuration structure for the ``setenv`` has the following prototype:
983
984.. code:: c
985
986    extern rtems_shell_cmd_t rtems_shell_SETENV_Command;
987
988.. _unsetenv:
989
990unsetenv - unset environment variable
991-------------------------------------
992.. index:: unsetenv
993
994**SYNOPSYS:**
995
996.. code:: shell
997
998    unsetenv variable
999
1000**DESCRIPTION:**
1001
1002This command is remove to a ``variable`` from the set of environment variables.
1003
1004**EXIT STATUS:**
1005
1006This command will return 1 and print a diagnostic message if a failure occurs.
1007
1008**NOTES:**
1009
1010The entire RTEMS application shares a single set of environment variables.
1011
1012**EXAMPLES:**
1013
1014The following is an example of how to use ``unsetenv``:
1015
1016.. code:: shell
1017
1018    SHLL [/] $ unsetenv BASEPATH
1019
1020**CONFIGURATION:**
1021
1022.. index:: CONFIGURE_SHELL_NO_COMMAND_UNSETENV
1023.. index:: CONFIGURE_SHELL_COMMAND_UNSETENV
1024
1025This command is included in the default shell command set.  When building a
1026custom command set, define ``CONFIGURE_SHELL_COMMAND_UNSETENV`` to have this
1027command included.
1028
1029This command can be excluded from the shell command set by defining
1030``CONFIGURE_SHELL_NO_COMMAND_UNSETENV`` when all shell commands have been
1031configured.
1032
1033**PROGRAMMING INFORMATION:**
1034
1035.. index:: rtems_shell_rtems_main_unsetenv
1036
1037The ``unsetenv`` is implemented by a C language function which has the
1038following prototype:
1039
1040.. code:: c
1041
1042    int rtems_shell_rtems_main_unsetenv(
1043        int    argc,
1044        char **argv
1045    );
1046
1047The configuration structure for the ``unsetenv`` has the following prototype:
1048
1049.. code:: c
1050
1051    extern rtems_shell_cmd_t rtems_shell_UNSETENV_Command;
1052
1053.. _time:
1054
1055time - time command execution
1056-----------------------------
1057.. index:: time
1058
1059**SYNOPSYS:**
1060
1061.. code:: c
1062
1063    time command [argument ...]
1064
1065**DESCRIPTION:**
1066
1067The time command executes and times a command.  After the command finishes,
1068time writes the total time elapsed.  Times are reported in seconds.
1069
1070**EXIT STATUS:**
1071
1072This command returns 0 on success and non-zero if an error is encountered.
1073
1074**NOTES:**
1075
1076None.
1077
1078**EXAMPLES:**
1079
1080The following is an example of how to use ``time``:
1081
1082.. code:: shell
1083
1084    SHLL [/] $ time cp -r /nfs/directory /c
1085
1086**CONFIGURATION:**
1087
1088.. index:: CONFIGURE_SHELL_NO_COMMAND_TIME
1089.. index:: CONFIGURE_SHELL_COMMAND_TIME
1090
1091This command is included in the default shell command set.  When building a
1092custom command set, define ``CONFIGURE_SHELL_COMMAND_TIME`` to have this command
1093included.
1094
1095This command can be excluded from the shell command set by defining
1096``CONFIGURE_SHELL_NO_COMMAND_TIME`` when all shell commands have been
1097configured.
1098
1099**PROGRAMMING INFORMATION:**
1100
1101.. index:: rtems_shell_rtems_main_time
1102
1103The ``time`` is implemented by a C language function which has the following
1104prototype:
1105
1106.. code:: c
1107
1108    int rtems_shell_rtems_main_time(
1109        int    argc,
1110        char **argv
1111    );
1112
1113The configuration structure for the ``time`` has the following prototype:
1114
1115.. code:: c
1116
1117    extern rtems_shell_cmd_t rtems_shell_TIME_Command;
1118
1119.. _logoff:
1120
1121logoff - logoff from the system
1122-------------------------------
1123.. index:: logoff
1124
1125**SYNOPSYS:**
1126
1127.. code:: shell
1128
1129    logoff
1130
1131**DESCRIPTION:**
1132
1133This command logs the user out of the shell.
1134
1135**EXIT STATUS:**
1136
1137This command does not return.
1138
1139**NOTES:**
1140
1141The system behavior when the shell is exited depends upon how the shell was
1142initiated.  The typical behavior is that a login prompt will be displayed for
1143the next login attempt or that the connection will be dropped by the RTEMS
1144system.
1145
1146**EXAMPLES:**
1147
1148The following is an example of how to use ``logoff``:
1149
1150.. code:: shell
1151
1152    SHLL [/] $ logoff
1153    logoff from the system...
1154
1155**CONFIGURATION:**
1156
1157.. index:: CONFIGURE_SHELL_NO_COMMAND_LOGOFF
1158.. index:: CONFIGURE_SHELL_COMMAND_LOGOFF
1159
1160This command is included in the default shell command set.  When building a
1161custom command set, define ``CONFIGURE_SHELL_COMMAND_LOGOFF`` to have this
1162command included.
1163
1164This command can be excluded from the shell command set by defining
1165``CONFIGURE_SHELL_NO_COMMAND_LOGOFF`` when all shell commands have been
1166configured.
1167
1168**PROGRAMMING INFORMATION:**
1169
1170.. index:: rtems_shell_rtems_main_logoff
1171
1172The ``logoff`` is implemented by a C language function which has the following
1173prototype:
1174
1175.. code:: c
1176
1177    int rtems_shell_rtems_main_logoff(
1178        int    argc,
1179        char **argv
1180    );
1181
1182The configuration structure for the ``logoff`` has the following prototype:
1183
1184.. code:: c
1185
1186    extern rtems_shell_cmd_t rtems_shell_LOGOFF_Command;
1187
1188.. _rtc:
1189
1190rtc - RTC driver configuration
1191------------------------------
1192.. index:: rtc
1193
1194**SYNOPSYS:**
1195
1196.. code:: shell
1197
1198    rtc
1199
1200**CONFIGURATION:**
1201
1202.. index:: CONFIGURE_SHELL_NO_COMMAND_RTC
1203.. index:: CONFIGURE_SHELL_COMMAND_RTC
1204
1205This command is included in the default shell command set.  When building a
1206custom command set, define ``CONFIGURE_SHELL_COMMAND_RTC`` to have this command
1207included.
1208
1209This command can be excluded from the shell command set by defining
1210``CONFIGURE_SHELL_NO_COMMAND_RTC`` when all shell commands have been
1211configured.
1212
1213.. _exit:
1214
1215exit - exit the shell
1216---------------------
1217.. index:: exit
1218
1219**SYNOPSYS:**
1220
1221.. code:: shell
1222
1223    exit
1224
1225**DESCRIPTION:**
1226
1227This command causes the shell interpreter to ``exit``.
1228
1229**EXIT STATUS:**
1230
1231This command does not return.
1232
1233**NOTES:**
1234
1235In contrast to `logoff - logoff from the system`, this command is built into
1236the shell interpreter loop.
1237
1238**EXAMPLES:**
1239
1240The following is an example of how to use ``exit``:
1241
1242.. code:: shell
1243
1244    SHLL [/] $ exit
1245    Shell exiting
1246
1247**CONFIGURATION:**
1248
1249This command is always present and cannot be disabled.
1250
1251**PROGRAMMING INFORMATION:**
1252
1253The ``exit`` is implemented directly in the shell interpreter.  There is no C
1254routine associated with it.
Note: See TracBrowser for help on using the repository browser.