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

4.115
Last change on this file since aa1c010 was f15d607, checked in by Chris Johns <chrisj@…>, on 11/09/16 at 00:50:31

shell: Fix header levels.

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