diff options
| author | Jim Porter | 2023-08-15 18:51:20 -0700 |
|---|---|---|
| committer | Jim Porter | 2024-02-04 21:12:42 -0800 |
| commit | 5c43ef86bf169a79b87bd082d2f884757f7c2efc (patch) | |
| tree | 67af86528581973610588dee645dbc395bf5ded8 | |
| parent | be6de56906f0d1c09a0fad4f5165d864dddbc3ee (diff) | |
| download | emacs-5c43ef86bf169a79b87bd082d2f884757f7c2efc.tar.gz emacs-5c43ef86bf169a79b87bd082d2f884757f7c2efc.zip | |
Document arguments to Eshell's built-in commands
* lisp/eshell/em-unix.el (eshell/ln): LINK_NAME is required.
* lisp/eshell/esh-ext.el (eshell/addpath):
* lisp/eshell/esh-var.el (eshell/env): Improve help strings slightly.
* doc/misc/eshell.texi (Scripts): Explain $0, $1, etc.
(Dollars Expansion): Use "@dots{}" instead of "...".
(Built-ins, Tramp extensions, Extra built-in commands): Document
command-line arguments.
| -rw-r--r-- | doc/misc/eshell.texi | 654 | ||||
| -rw-r--r-- | lisp/eshell/em-unix.el | 8 | ||||
| -rw-r--r-- | lisp/eshell/esh-ext.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-var.el | 2 |
4 files changed, 497 insertions, 173 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index da5e1ef1d03..5d3e5c7dbd6 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -481,72 +481,88 @@ loaded as part of the eshell-xtra module. @xref{Extension modules}. | |||
| 481 | 481 | ||
| 482 | @table @code | 482 | @table @code |
| 483 | 483 | ||
| 484 | @item . | 484 | @item . @var{file} [@var{argument}]@dots{} |
| 485 | @cmindex . | 485 | @cmindex . |
| 486 | Source an Eshell file in the current environment. This is not to be | 486 | Source an Eshell script named @var{file} in the current environment, |
| 487 | confused with the command @command{source}, which sources a file in a | 487 | passing any @var{arguments} to the script (@pxref{Scripts}). This is |
| 488 | subshell environment. | 488 | not to be confused with the command @command{source}, which sources a |
| 489 | file in a subshell environment. | ||
| 489 | 490 | ||
| 490 | @item addpath | 491 | @item addpath |
| 492 | @itemx addpath [-b] @var{directory}@dots{} | ||
| 491 | @cmindex addpath | 493 | @cmindex addpath |
| 492 | Adds a given path or set of paths to the PATH environment variable, or, | 494 | Adds each specified @var{directory} to the @code{$PATH} environment |
| 493 | with no arguments, prints the current paths in this variable. | 495 | variable. By default, this adds the directories to the end of |
| 496 | @code{$PATH}, in the order they were passed on the command line; by | ||
| 497 | passing @code{-b} or @code{--begin}, Eshell will instead add the | ||
| 498 | directories to the beginning. | ||
| 499 | |||
| 500 | With no directories, print the list of directories currently stored in | ||
| 501 | @code{$PATH}. | ||
| 494 | 502 | ||
| 495 | @item alias | 503 | @item alias |
| 504 | @itemx alias @var{name} [@var{command}] | ||
| 496 | @cmindex alias | 505 | @cmindex alias |
| 497 | Define an alias (@pxref{Aliases}). This adds it to the aliases file. | 506 | Define an alias named @var{name} and expanding to @var{command}, |
| 507 | adding it to the aliases file (@pxref{Aliases}). If @var{command} is | ||
| 508 | omitted, delete the alias named @var{name}. With no arguments at all, | ||
| 509 | list all the currently-defined aliases. | ||
| 498 | 510 | ||
| 499 | @item basename | 511 | @item basename @var{filename} |
| 500 | @cmindex basename | 512 | @cmindex basename |
| 501 | Return a file name without its directory. | 513 | Return @var{filename} without its directory. |
| 502 | 514 | ||
| 503 | @item cat | 515 | @item cat @var{file}@dots{} |
| 504 | @cmindex cat | 516 | @cmindex cat |
| 505 | Concatenate file contents into standard output. If in a pipeline, or | 517 | Concatenate the contents of @var{file}s to standard output. If in a |
| 506 | if the file is not a regular file, directory, or symlink, then this | 518 | pipeline, or if any of the files is not a regular file, directory, or |
| 507 | command reverts to the system's definition of @command{cat}. | 519 | symlink, then this command reverts to the system's definition of |
| 520 | @command{cat}. | ||
| 508 | 521 | ||
| 509 | @item cd | 522 | @item cd |
| 523 | @itemx cd @var{directory} | ||
| 524 | @itemx cd -[@var{n}] | ||
| 525 | @itemx cd =[@var{regexp}] | ||
| 510 | @cmindex cd | 526 | @cmindex cd |
| 511 | This command changes the current working directory. Usually, it is | 527 | Change the current working directory. This command can take several |
| 512 | invoked as @kbd{cd @var{dir}} where @file{@var{dir}} is the new | 528 | forms: |
| 513 | working directory. But @command{cd} knows about a few special | ||
| 514 | arguments: | ||
| 515 | 529 | ||
| 516 | @itemize @minus{} | 530 | @table @code |
| 517 | @item | ||
| 518 | When it receives no argument at all, it changes to the home directory. | ||
| 519 | 531 | ||
| 520 | @item | 532 | @item cd |
| 521 | Giving the command @kbd{cd -} changes back to the previous working | 533 | Change to the user's home directory. |
| 522 | directory (this is the same as @kbd{cd $-}). | ||
| 523 | 534 | ||
| 524 | @item | 535 | @item cd @var{directory} |
| 525 | The command @kbd{cd =} shows the directory ring. Each line is | 536 | Change to the specified @var{directory}. |
| 526 | numbered. | ||
| 527 | 537 | ||
| 528 | @item | 538 | @item cd - |
| 529 | With @kbd{cd =foo}, Eshell searches the directory ring for a directory | 539 | Change back to the previous working directory (this is the same as |
| 530 | matching the regular expression @samp{foo}, and changes to that | 540 | @kbd{cd $-}). |
| 531 | directory. | ||
| 532 | 541 | ||
| 533 | @item | 542 | @item cd -@var{n} |
| 534 | With @kbd{cd -42}, you can access the directory stack slots by number. | 543 | Change to the directory in the @var{nth} slot of the directory stack. |
| 544 | |||
| 545 | @item cd = | ||
| 546 | Show the directory ring. Each line is numbered. | ||
| 547 | |||
| 548 | @item cd =@var{regexp} | ||
| 549 | Search the directory ring for a directory matching the regular | ||
| 550 | expression @var{regexp} and change to that directory. | ||
| 551 | |||
| 552 | @end table | ||
| 535 | 553 | ||
| 536 | @item | ||
| 537 | @vindex eshell-cd-shows-directory | 554 | @vindex eshell-cd-shows-directory |
| 538 | @vindex eshell-list-files-after-cd | 555 | @vindex eshell-list-files-after-cd |
| 539 | If @code{eshell-cd-shows-directory} is non-@code{nil}, @command{cd} | 556 | If @code{eshell-cd-shows-directory} is non-@code{nil}, @command{cd} |
| 540 | will report the directory it changes to. If | 557 | will report the directory it changes to. If |
| 541 | @code{eshell-list-files-after-cd} is non-@code{nil}, then @command{ls} | 558 | @code{eshell-list-files-after-cd} is non-@code{nil}, then @command{ls} |
| 542 | is called with any remaining arguments after changing directories. | 559 | is called with any remaining arguments after changing directories. |
| 543 | @end itemize | ||
| 544 | 560 | ||
| 545 | @item clear | 561 | @item clear [@var{scrollback}] |
| 546 | @cmindex clear | 562 | @cmindex clear |
| 547 | Scrolls the contents of the Eshell window out of sight, leaving a | 563 | Scrolls the contents of the Eshell window out of sight, leaving a |
| 548 | blank window. If provided with an optional non-@code{nil} argument, | 564 | blank window. If @var{scrollback} is non-@code{nil}, the scrollback |
| 549 | the scrollback contents are cleared instead. | 565 | contents are cleared instead, as with @command{clear-scrollback}. |
| 550 | 566 | ||
| 551 | @item clear-scrollback | 567 | @item clear-scrollback |
| 552 | @cmindex clear-scrollback | 568 | @cmindex clear-scrollback |
| @@ -554,21 +570,30 @@ Clear the scrollback contents of the Eshell window. Unlike the | |||
| 554 | command @command{clear}, this command deletes content in the Eshell | 570 | command @command{clear}, this command deletes content in the Eshell |
| 555 | buffer. | 571 | buffer. |
| 556 | 572 | ||
| 557 | @item compile | 573 | @item compile [-p | -i] [-m @var{mode-name}] @var{command}@dots{} |
| 558 | @cmindex compile | 574 | @cmindex compile |
| 559 | Run an external command, sending its output to a compilation buffer if | 575 | Run an external command, sending its output to a compilation buffer if |
| 560 | the command would output to the screen and is not part of a pipeline | 576 | the command would output to the screen and is not part of a pipeline |
| 561 | or subcommand. This is particularly useful when defining aliases, so | 577 | or subcommand. |
| 578 | |||
| 579 | With the @code{-p} or @code{--plain} options, always send the output | ||
| 580 | to the Eshell buffer; similarly, with @code{-i} or | ||
| 581 | @code{--interactive}, always send the output to a compilation buffer. | ||
| 582 | You can also set the mode of the compilation buffer with @code{-m | ||
| 583 | @var{mode-name}} or @code{--mode @var{mode-name}}. | ||
| 584 | |||
| 585 | @command{compile} is particularly useful when defining aliases, so | ||
| 562 | that interactively, the output shows up in a compilation buffer, but | 586 | that interactively, the output shows up in a compilation buffer, but |
| 563 | you can still pipe the output elsewhere if desired. For example, if | 587 | you can still pipe the output elsewhere if desired. For example, if |
| 564 | you have a grep-like command on your system, you might define an alias | 588 | you have a grep-like command on your system, you might define an alias |
| 565 | for it like so: @samp{alias mygrep 'compile --mode=grep-mode -- mygrep | 589 | for it like so: @samp{alias mygrep 'compile --mode=grep-mode -- mygrep |
| 566 | $*'}. | 590 | $*'}. |
| 567 | 591 | ||
| 568 | @item cp | 592 | @item cp [@var{option}@dots{}] @var{source} @var{dest} |
| 593 | @item cp [@var{option}@dots{}] @var{source}@dots{} @var{directory} | ||
| 569 | @cmindex cp | 594 | @cmindex cp |
| 570 | Copy a file to a new location or copy multiple files to the same | 595 | Copy the file @var{source} to @var{dest} or @var{source} into |
| 571 | directory. | 596 | @var{directory}. |
| 572 | 597 | ||
| 573 | @vindex eshell-cp-overwrite-files | 598 | @vindex eshell-cp-overwrite-files |
| 574 | @vindex eshell-cp-interactive-query | 599 | @vindex eshell-cp-interactive-query |
| @@ -577,26 +602,59 @@ If @code{eshell-cp-overwrite-files} is non-@code{nil}, then | |||
| 577 | @code{eshell-cp-interactive-query} is non-@code{nil}, then | 602 | @code{eshell-cp-interactive-query} is non-@code{nil}, then |
| 578 | @command{cp} will ask before overwriting anything. | 603 | @command{cp} will ask before overwriting anything. |
| 579 | 604 | ||
| 580 | @item date | 605 | @command{cp} accepts the following options: |
| 606 | |||
| 607 | @table @asis | ||
| 608 | |||
| 609 | @item @code{-a}, @code{--archive} | ||
| 610 | Equivalent to @code{--no-dereference --preserve --recursive}. | ||
| 611 | |||
| 612 | @item @code{-d}, @code{--no-dereference} | ||
| 613 | Don't dereference symbolic links when copying; instead, copy the link | ||
| 614 | itself. | ||
| 615 | |||
| 616 | @item @code{-f}, @code{--force} | ||
| 617 | Never prompt for confirmation before copying a file. | ||
| 618 | |||
| 619 | @item @code{-i}, @code{--interactive} | ||
| 620 | Prompt for confirmation before copying a file if the target already | ||
| 621 | exists. | ||
| 622 | |||
| 623 | @item @code{-n}, @code{--preview} | ||
| 624 | Run the command, but don't copy anything. This is useful if you | ||
| 625 | want to preview what would be removed when calling @command{cp}. | ||
| 626 | |||
| 627 | @item @code{-p}, @code{--preserve} | ||
| 628 | Attempt to preserve file attributes when copying. | ||
| 629 | |||
| 630 | @item @code{-r}, @code{-R}, @code{--recursive} | ||
| 631 | Copy any specified directories and their contents recursively. | ||
| 632 | |||
| 633 | @item @code{-v}, @code{--verbose} | ||
| 634 | Print the name of each file before copying it. | ||
| 635 | |||
| 636 | @end table | ||
| 637 | |||
| 638 | @item date [@var{specified-time} [@var{zone}]] | ||
| 581 | @cmindex date | 639 | @cmindex date |
| 582 | Print the current local time as a human-readable string. This command | 640 | Print the current local time as a human-readable string. This command |
| 583 | is similar to, but slightly different from, the GNU Coreutils | 641 | is an alias to the Emacs Lisp function @code{current-time-string} |
| 584 | @command{date} command. | 642 | (@pxref{Time of Day,,, elisp, GNU Emacs Lisp Reference Manual}). |
| 585 | 643 | ||
| 586 | @item diff | 644 | @item diff [@var{option}]@dots{} @var{old} @var{new} |
| 587 | @cmindex diff | 645 | @cmindex diff |
| 588 | Compare files using Emacs's internal @code{diff} (not to be confused | 646 | Compare the files @var{old} and @var{new} using Emacs's internal |
| 589 | with @code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs | 647 | @code{diff} (not to be confused with @code{ediff}). @xref{Comparing |
| 590 | Manual}. | 648 | Files, , , emacs, The GNU Emacs Manual}. |
| 591 | 649 | ||
| 592 | @vindex eshell-plain-diff-behavior | 650 | @vindex eshell-plain-diff-behavior |
| 593 | If @code{eshell-plain-diff-behavior} is non-@code{nil}, then this | 651 | If @code{eshell-plain-diff-behavior} is non-@code{nil}, then this |
| 594 | command does not use Emacs's internal @code{diff}. This is the same | 652 | command does not use Emacs's internal @code{diff}. This is the same |
| 595 | as using @samp{alias diff '*diff $@@*'}. | 653 | as using @samp{alias diff '*diff $@@*'}. |
| 596 | 654 | ||
| 597 | @item dirname | 655 | @item dirname @var{filename} |
| 598 | @cmindex dirname | 656 | @cmindex dirname |
| 599 | Return the directory component of a file name. | 657 | Return the directory component of @var{filename}. |
| 600 | 658 | ||
| 601 | @item dirs | 659 | @item dirs |
| 602 | @cmindex dirs | 660 | @cmindex dirs |
| @@ -604,25 +662,75 @@ Prints the directory stack. Directories can be added or removed from | |||
| 604 | the stack using the commands @command{pushd} and @command{popd}, | 662 | the stack using the commands @command{pushd} and @command{popd}, |
| 605 | respectively. | 663 | respectively. |
| 606 | 664 | ||
| 607 | @item du | 665 | @item du [@var{option}]@dots{} @var{file}@dots{} |
| 608 | @cmindex du | 666 | @cmindex du |
| 609 | Summarize disk usage for each file. | 667 | Summarize disk usage for each file, recursing into directories. |
| 668 | |||
| 669 | @command{du} accepts the following options: | ||
| 670 | |||
| 671 | @table @asis | ||
| 672 | |||
| 673 | @item @code{-a}, @code{--all} | ||
| 674 | Print sizes for files, not just directories. | ||
| 610 | 675 | ||
| 611 | @item echo | 676 | @item @code{--block-size=@var{size}} |
| 677 | Print sizes as number of blocks of size @var{size}. | ||
| 678 | |||
| 679 | @item @code{-b}, @code{--bytes} | ||
| 680 | Print file sizes in bytes. | ||
| 681 | |||
| 682 | @item @code{-c}, @code{--total} | ||
| 683 | Print a grand total of the sizes at the end. | ||
| 684 | |||
| 685 | @item @code{-d}, @code{--max-depth=@var{depth}} | ||
| 686 | Only print sizes for directories (or files with @code{--all}) that are | ||
| 687 | @var{depth} or fewer levels below the command line arguments. | ||
| 688 | |||
| 689 | @item @code{-h}, @code{--human-readable} | ||
| 690 | Print sizes in human-readable format, with binary prefixes (so 1 KB is | ||
| 691 | 1024 bytes). | ||
| 692 | |||
| 693 | @item @code{-H}, @code{--si} | ||
| 694 | Print sizes in human-readable format, with decimal prefixes (so 1 KB | ||
| 695 | is 1000 bytes). | ||
| 696 | |||
| 697 | @item @code{-k}, @code{--kilobytes} | ||
| 698 | Print file sizes in kilobytes (like @code{--block-size=1024}). | ||
| 699 | |||
| 700 | @item @code{-L}, @code{--dereference} | ||
| 701 | Follow symbolic links when traversing files. | ||
| 702 | |||
| 703 | @item @code{-m}, @code{--megabytes} | ||
| 704 | Print file sizes in megabytes (like @code{--block-size=1048576}). | ||
| 705 | |||
| 706 | @item @code{-s}, @code{--summarize} | ||
| 707 | Don't recurse into subdirectories (like @code{--max-depth=0}). | ||
| 708 | |||
| 709 | @item @code{-x}, @code{--one-file-system} | ||
| 710 | Skip any directories that reside on different filesystems. | ||
| 711 | |||
| 712 | @end table | ||
| 713 | |||
| 714 | @item echo [-n | -N] [@var{arg}]@dots{} | ||
| 612 | @cmindex echo | 715 | @cmindex echo |
| 613 | Echoes its input. By default, this prints in a Lisp-friendly fashion | 716 | Prints the value of each @var{arg}. By default, this prints in a |
| 614 | (so that the value is useful to a Lisp command using the result of | 717 | Lisp-friendly fashion (so that the value is useful to a Lisp command |
| 615 | @command{echo} as an argument). If a single argument is passed, | 718 | using the result of @command{echo} as an argument). If a single |
| 616 | @command{echo} prints that; if multiple arguments are passed, it | 719 | argument is passed, @command{echo} prints that; if multiple arguments |
| 617 | prints a list of all the arguments; otherwise, it prints the empty | 720 | are passed, it prints a list of all the arguments; otherwise, it |
| 618 | string. | 721 | prints the empty string. |
| 619 | 722 | ||
| 620 | @vindex eshell-plain-echo-behavior | 723 | @vindex eshell-plain-echo-behavior |
| 621 | If @code{eshell-plain-echo-behavior} is non-@code{nil}, @command{echo} | 724 | If @code{eshell-plain-echo-behavior} is non-@code{nil}, @command{echo} |
| 622 | will try to behave more like a plain shell's @command{echo}, printing | 725 | will try to behave more like a plain shell's @command{echo}, printing |
| 623 | each argument as a string, separated by a space. | 726 | each argument as a string, separated by a space. |
| 624 | 727 | ||
| 625 | @item env | 728 | You can control whether @command{echo} outputs a trailing newline |
| 729 | using @code{-n} to disable the trailing newline (the default behavior) | ||
| 730 | or @code{-N} to enable it (the default when | ||
| 731 | @code{eshell-plain-echo-behavior} is non-@code{nil}). | ||
| 732 | |||
| 733 | @item env [@var{var}=@var{value}]@dots{} [@var{command}]@dots{} | ||
| 626 | @cmindex env | 734 | @cmindex env |
| 627 | With no arguments, print the current environment variables. If you | 735 | With no arguments, print the current environment variables. If you |
| 628 | pass arguments to this command, then @command{env} will execute the | 736 | pass arguments to this command, then @command{env} will execute the |
| @@ -630,7 +738,7 @@ arguments as a command. If you pass any initial arguments of the form | |||
| 630 | @samp{@var{var}=@var{value}}, @command{env} will first set @var{var} | 738 | @samp{@var{var}=@var{value}}, @command{env} will first set @var{var} |
| 631 | to @var{value} before running the command. | 739 | to @var{value} before running the command. |
| 632 | 740 | ||
| 633 | @item eshell-debug | 741 | @item eshell-debug [error | form | process]@dots{} |
| 634 | @cmindex eshell-debug | 742 | @cmindex eshell-debug |
| 635 | Toggle debugging information for Eshell itself. You can pass this | 743 | Toggle debugging information for Eshell itself. You can pass this |
| 636 | command one or more of the following arguments: | 744 | command one or more of the following arguments: |
| @@ -658,65 +766,86 @@ Exit Eshell and save the history. By default, this command kills the | |||
| 658 | Eshell buffer, but if @code{eshell-kill-on-exit} is @code{nil}, then | 766 | Eshell buffer, but if @code{eshell-kill-on-exit} is @code{nil}, then |
| 659 | the buffer is merely buried instead. | 767 | the buffer is merely buried instead. |
| 660 | 768 | ||
| 661 | @item export | 769 | @item export [@var{name}=@var{value}]@dots{} |
| 662 | @cmindex export | 770 | @cmindex export |
| 663 | Set environment variables using input like Bash's @command{export}, as | 771 | Set environment variables using input like Bash's @command{export}, as |
| 664 | in @samp{export @var{var1}=@var{val1} @var{var2}=@var{val2} @dots{}}. | 772 | in @samp{export @var{var1}=@var{val1} @var{var2}=@var{val2} @dots{}}. |
| 665 | 773 | ||
| 666 | @item grep | 774 | @item grep [@var{arg}]@dots{} |
| 667 | @cmindex grep | 775 | @cmindex grep |
| 668 | @itemx agrep | 776 | @itemx agrep [@var{arg}]@dots{} |
| 669 | @cmindex agrep | 777 | @cmindex agrep |
| 670 | @itemx egrep | 778 | @itemx egrep [@var{arg}]@dots{} |
| 671 | @cmindex egrep | 779 | @cmindex egrep |
| 672 | @itemx fgrep | 780 | @itemx fgrep [@var{arg}]@dots{} |
| 673 | @cmindex fgrep | 781 | @cmindex fgrep |
| 674 | @itemx rgrep | 782 | @itemx rgrep [@var{arg}]@dots{} |
| 675 | @cmindex rgrep | 783 | @cmindex rgrep |
| 676 | @itemx glimpse | 784 | @itemx glimpse [@var{arg}]@dots{} |
| 677 | @cmindex glimpse | 785 | @cmindex glimpse |
| 678 | The @command{grep} commands are compatible with GNU @command{grep}, | 786 | The @command{grep} commands are compatible with GNU @command{grep}, |
| 679 | but use Emacs's internal @code{grep} instead. | 787 | but open a compilation buffer in @code{grep-mode} instead. |
| 680 | @xref{Grep Searching, , , emacs, The GNU Emacs Manual}. | 788 | @xref{Grep Searching, , , emacs, The GNU Emacs Manual}. |
| 681 | 789 | ||
| 682 | @vindex eshell-plain-grep-behavior | 790 | @vindex eshell-plain-grep-behavior |
| 683 | If @code{eshell-plain-grep-behavior} is non-@code{nil}, then these | 791 | If @code{eshell-plain-grep-behavior} is non-@code{nil}, then these |
| 684 | commands do not use Emacs's internal @code{grep}. This is the same as | 792 | commands do not use open a compilation buffer, instead printing output |
| 685 | using @samp{alias grep '*grep $@@*'}, though this setting applies to | 793 | to Eshell's buffer. This is the same as using @samp{alias grep '*grep |
| 686 | all of the built-in commands for which you would need to create a | 794 | $@@*'}, though this setting applies to all of the built-in commands |
| 687 | separate alias. | 795 | for which you would need to create a separate alias. |
| 688 | 796 | ||
| 689 | @item history | 797 | @item history [@var{n}] |
| 798 | @itemx history [-arw] [@var{filename}] | ||
| 690 | @cmindex history | 799 | @cmindex history |
| 691 | Prints Eshell's input history. With a numeric argument @var{N}, this | 800 | Prints Eshell's input history. With a numeric argument @var{n}, this |
| 692 | command prints the @var{N} most recent items in the history. | 801 | command prints the @var{n} most recent items in the history. |
| 802 | Alternately, you can specify the following options: | ||
| 803 | |||
| 804 | @table @asis | ||
| 805 | |||
| 806 | @item @code{-a}, @code{--append} | ||
| 807 | Append new history items to the history file. | ||
| 693 | 808 | ||
| 694 | @item info | 809 | @item @code{-r}, @code{--read} |
| 810 | Read history items from the history file and append them to the | ||
| 811 | current shell's history. | ||
| 812 | |||
| 813 | @item @code{-w}, @code{--write} | ||
| 814 | Write the current history list to the history file. | ||
| 815 | |||
| 816 | @end table | ||
| 817 | |||
| 818 | @item info [@var{manual} [@var{item}]@dots{}] | ||
| 695 | @cmindex info | 819 | @cmindex info |
| 696 | Browse the available Info documentation. This command is the same as | 820 | Browse the available Info documentation. With no arguments, browse |
| 697 | the external @command{info} command, but uses Emacs's internal Info | 821 | the top-level menu. Otherwise, show the manual for @var{manual}, |
| 698 | reader. | 822 | selecting the menu entry for @var{item}. |
| 699 | @xref{Misc Help, , , emacs, The GNU Emacs Manual}. | 823 | |
| 824 | This command is the same as the external @command{info} command, but | ||
| 825 | uses Emacs's internal Info reader. @xref{Misc Help, , , emacs, The | ||
| 826 | GNU Emacs Manual}. | ||
| 700 | 827 | ||
| 701 | @item jobs | 828 | @item jobs |
| 702 | @cmindex jobs | 829 | @cmindex jobs |
| 703 | List subprocesses of the Emacs process, if any, using the function | 830 | List subprocesses of the Emacs process, if any, using the function |
| 704 | @code{list-processes}. | 831 | @code{list-processes}. |
| 705 | 832 | ||
| 706 | @item kill | 833 | @item kill [-@var{signal}] [@var{pid} | @var{process}] |
| 707 | @cmindex kill | 834 | @cmindex kill |
| 708 | Kill processes. Takes a PID or a process object and an optional | 835 | Kill processes. Takes a PID or a process object and an optional |
| 709 | signal specifier which can either be a number or a signal name. | 836 | @var{signal} specifier which can either be a number or a signal name. |
| 710 | 837 | ||
| 711 | @item listify | 838 | @item listify [@var{arg}]@dots{} |
| 712 | @cmindex listify | 839 | @cmindex listify |
| 713 | Eshell version of @code{list}. Allows you to create a list using Eshell | 840 | Return the arguments as a single list. With a single argument, return |
| 714 | syntax, rather than Elisp syntax. For example, @samp{listify foo bar} | 841 | it as-is if it's already a list, or otherwise wrap it in a list. With |
| 715 | and @code{("foo" "bar")} both evaluate to @code{("foo" "bar")}. | 842 | multiple arguments, return a list of all of them. |
| 716 | 843 | ||
| 717 | @item ln | 844 | @item ln [@var{option}]@dots{} @var{target} [@var{link-name}] |
| 845 | @itemx ln [@var{option}]@dots{} @var{target}@dots{} @var{directory} | ||
| 718 | @cmindex ln | 846 | @cmindex ln |
| 719 | Create links to files. | 847 | Create a link to the specified @var{target} named @var{link-name} or |
| 848 | create links to multiple @var{targets} in @var{directory}. | ||
| 720 | 849 | ||
| 721 | @vindex eshell-ln-overwrite-files | 850 | @vindex eshell-ln-overwrite-files |
| 722 | @vindex eshell-ln-interactive-query | 851 | @vindex eshell-ln-interactive-query |
| @@ -725,7 +854,30 @@ will overwrite files without warning. If | |||
| 725 | @code{eshell-ln-interactive-query} is non-@code{nil}, then | 854 | @code{eshell-ln-interactive-query} is non-@code{nil}, then |
| 726 | @command{ln} will ask before overwriting files. | 855 | @command{ln} will ask before overwriting files. |
| 727 | 856 | ||
| 728 | @item locate | 857 | @command{ln} accepts the following options: |
| 858 | |||
| 859 | @table @asis | ||
| 860 | |||
| 861 | @item @code{-f}, @code{--force} | ||
| 862 | Never prompt for confirmation before linking a target. | ||
| 863 | |||
| 864 | @item @code{-i}, @code{--interactive} | ||
| 865 | Prompt for confirmation before linking to an item if the source | ||
| 866 | already exists. | ||
| 867 | |||
| 868 | @item @code{-n}, @code{--preview} | ||
| 869 | Run the command, but don't move anything. This is useful if you | ||
| 870 | want to preview what would be linked when calling @command{ln}. | ||
| 871 | |||
| 872 | @item @code{-s}, @code{--symbolic} | ||
| 873 | Make symbolic links instead of hard links. | ||
| 874 | |||
| 875 | @item @code{-v}, @code{--verbose} | ||
| 876 | Print the name of each file before linking it. | ||
| 877 | |||
| 878 | @end table | ||
| 879 | |||
| 880 | @item locate @var{arg}@dots{} | ||
| 729 | @cmindex locate | 881 | @cmindex locate |
| 730 | Alias to Emacs's @code{locate} function, which simply runs the external | 882 | Alias to Emacs's @code{locate} function, which simply runs the external |
| 731 | @command{locate} command and parses the results. | 883 | @command{locate} command and parses the results. |
| @@ -736,51 +888,129 @@ If @code{eshell-plain-locate-behavior} is non-@code{nil}, then Emacs's | |||
| 736 | internal @code{locate} is not used. This is the same as using | 888 | internal @code{locate} is not used. This is the same as using |
| 737 | @samp{alias locate '*locate $@@*'}. | 889 | @samp{alias locate '*locate $@@*'}. |
| 738 | 890 | ||
| 739 | @item ls | 891 | @item ls [@var{option}]@dots{} [@var{file}]@dots{} |
| 740 | @cmindex ls | 892 | @cmindex ls |
| 741 | Lists the contents of directories. | 893 | List information about each @var{file}, including the contents of any |
| 894 | specified directories. If @var{file} is unspecified, list the | ||
| 895 | contents of the current directory. | ||
| 896 | |||
| 897 | @vindex eshell-ls-initial-args | ||
| 898 | The user option @code{eshell-ls-initial-args} contains a list of | ||
| 899 | arguments to include with any call to @command{ls}. For example, you | ||
| 900 | can include the option @option{-h} to always use a more human-readable | ||
| 901 | format. | ||
| 742 | 902 | ||
| 743 | @vindex eshell-ls-use-colors | 903 | @vindex eshell-ls-use-colors |
| 744 | If @code{eshell-ls-use-colors} is non-@code{nil}, the contents of a | 904 | If @code{eshell-ls-use-colors} is non-@code{nil}, the contents of a |
| 745 | directory is color-coded according to file type and status. These | 905 | directory is color-coded according to file type and status. These |
| 746 | colors and the regexps used to identify their corresponding files can | 906 | colors and the regexps used to identify their corresponding files can |
| 747 | be customized via @w{@kbd{M-x customize-group @key{RET} eshell-ls @key{RET}}}. | 907 | be customized via @w{@kbd{M-x customize-group @key{RET} eshell-ls |
| 908 | @key{RET}}}. | ||
| 909 | |||
| 910 | @command{ls} supports the following options: | ||
| 911 | |||
| 912 | @table @asis | ||
| 913 | |||
| 914 | @item @code{-a}, @code{--all} | ||
| 915 | List all files, including ones starting with @samp{.}. | ||
| 916 | |||
| 917 | @item @code{-A}, @code{--almost-all} | ||
| 918 | Like @code{--all}, but don't list the current directory (@file{.}) or | ||
| 919 | the parent directory (@file{..}). | ||
| 920 | |||
| 921 | @item @code{-c}, @code{--by-ctime} | ||
| 922 | Sort files by last status change time, with newest files first. | ||
| 923 | |||
| 924 | @item @code{-C} | ||
| 925 | List entries by columns. | ||
| 926 | |||
| 927 | @item @code{-d}, @code{--directory} | ||
| 928 | List directory entries instead of their contents. | ||
| 929 | |||
| 930 | @item @code{-h}, @code{--human-readable} | ||
| 931 | Print sizes in human-readable format, with binary prefixes (so 1 KB is | ||
| 932 | 1024 bytes). | ||
| 933 | |||
| 934 | @item @code{-H}, @code{--si} | ||
| 935 | Print sizes in human-readable format, with decimal prefixes (so 1 KB | ||
| 936 | is 1000 bytes). | ||
| 937 | |||
| 938 | @item @code{-I@var{pattern}}, @code{--ignore=@var{pattern}} | ||
| 939 | Don't list directory entries matching @var{pattern}. | ||
| 940 | |||
| 941 | @item @code{-k}, @code{--kilobytes} | ||
| 942 | Print sizes as 1024-byte kilobytes. | ||
| 748 | 943 | ||
| 749 | @vindex eshell-ls-date-format | 944 | @vindex eshell-ls-date-format |
| 750 | The user option @code{eshell-ls-date-format} determines how the date | 945 | @item @code{-l} |
| 751 | is displayed when using the @option{-l} option. The date is produced | 946 | Use a long listing format showing details for each file. The user |
| 752 | using the function @code{format-time-string} (@pxref{Time Parsing,,, | 947 | option @code{eshell-ls-date-format} determines how the date is |
| 753 | elisp, GNU Emacs Lisp Reference Manual}). | 948 | displayed when using this option. The date is produced using the |
| 949 | function @code{format-time-string} (@pxref{Time Parsing,,, elisp, GNU | ||
| 950 | Emacs Lisp Reference Manual}). | ||
| 754 | 951 | ||
| 755 | @vindex eshell-ls-initial-args | 952 | @item @code{-L}, @code{--dereference} |
| 756 | The user option @code{eshell-ls-initial-args} contains a list of | 953 | Follow symbolic links when listing entries. |
| 757 | arguments to include with any call to @command{ls}. For example, you | 954 | |
| 758 | can include the option @option{-h} to always use a more human-readable | 955 | @item @code{-n}, @code{--numeric-uid-gid} |
| 759 | format. | 956 | Show UIDs and GIDs numerically, instead of using their names. |
| 957 | |||
| 958 | @item @code{-r}, @code{--reverse} | ||
| 959 | Reverse order when sorting. | ||
| 960 | |||
| 961 | @item @code{-R}, @code{--recursive} | ||
| 962 | List subdirectories recursively. | ||
| 963 | |||
| 964 | @item @code{-s}, @code{--size} | ||
| 965 | Show the size of each file in blocks. | ||
| 760 | 966 | ||
| 761 | @vindex eshell-ls-default-blocksize | 967 | @vindex eshell-ls-default-blocksize |
| 762 | The user option @code{eshell-ls-default-blocksize} determines the | 968 | @item @code{-S} |
| 763 | default blocksize used when displaying file sizes with the option | 969 | Sort by file size, with largest files first. The user option |
| 764 | @option{-s}. | 970 | @code{eshell-ls-default-blocksize} determines the default blocksize |
| 971 | used when displaying file sizes with this option. | ||
| 972 | |||
| 973 | @item @code{-t} | ||
| 974 | Sort by modification time, with newest files first. | ||
| 765 | 975 | ||
| 766 | @item make | 976 | @item @code{-u} |
| 977 | Sort by last access time, with newest files first. | ||
| 978 | |||
| 979 | @item @code{-U} | ||
| 980 | Do not sort results. Instead, list entries in their directory order. | ||
| 981 | |||
| 982 | @item @code{-x} | ||
| 983 | List entries by lines instead of by columns. | ||
| 984 | |||
| 985 | @item @code{-X} | ||
| 986 | Sort alphabetically by file extension. | ||
| 987 | |||
| 988 | @item @code{-1} | ||
| 989 | List one file per line. | ||
| 990 | |||
| 991 | @end table | ||
| 992 | |||
| 993 | @item make [@var{arg}]@dots{} | ||
| 767 | @cmindex make | 994 | @cmindex make |
| 768 | Run @command{make} through @code{compile} when run asynchronously | 995 | Run @command{make} through @code{compile} when run asynchronously |
| 769 | (e.g., @samp{make &}). @xref{Compilation, , , emacs, The GNU Emacs | 996 | (e.g., @samp{make &}). @xref{Compilation, , , emacs, The GNU Emacs |
| 770 | Manual}. Otherwise call the external @command{make} command. | 997 | Manual}. Otherwise call the external @command{make} command. |
| 771 | 998 | ||
| 772 | @item man | 999 | @item man [@var{arg}]@dots{} |
| 773 | @cmindex man | 1000 | @cmindex man |
| 774 | Display Man pages using the Emacs @code{man} command. | 1001 | Display Man pages using the Emacs @code{man} command. |
| 775 | @xref{Man Page, , , emacs, The GNU Emacs Manual}. | 1002 | @xref{Man Page, , , emacs, The GNU Emacs Manual}. |
| 776 | 1003 | ||
| 777 | @item mkdir | 1004 | @item mkdir [-p] @var{directory}@dots{} |
| 778 | @cmindex mkdir | 1005 | @cmindex mkdir |
| 779 | Make new directories. | 1006 | Make new directories. With @code{-p} or @code{--parents}, |
| 1007 | automatically make any necessary parent directories as well. | ||
| 780 | 1008 | ||
| 781 | @item mv | 1009 | @item mv [@var{option}]@dots{} @var{source} @var{dest} |
| 1010 | @itemx mv [@var{option}]@dots{} @var{source}@dots{} @var{directory} | ||
| 782 | @cmindex mv | 1011 | @cmindex mv |
| 783 | Move or rename files. | 1012 | Rename the file @var{source} to @var{dest} or move @var{source} into |
| 1013 | @var{directory}. | ||
| 784 | 1014 | ||
| 785 | @vindex eshell-mv-overwrite-files | 1015 | @vindex eshell-mv-overwrite-files |
| 786 | @vindex eshell-mv-interactive-query | 1016 | @vindex eshell-mv-interactive-query |
| @@ -789,40 +1019,93 @@ will overwrite files without warning. If | |||
| 789 | @code{eshell-mv-interactive-query} is non-@code{nil}, @command{mv} | 1019 | @code{eshell-mv-interactive-query} is non-@code{nil}, @command{mv} |
| 790 | will prompt before overwriting anything. | 1020 | will prompt before overwriting anything. |
| 791 | 1021 | ||
| 792 | @item occur | 1022 | @command{mv} accepts the following options: |
| 1023 | |||
| 1024 | @table @asis | ||
| 1025 | |||
| 1026 | @item @code{-f}, @code{--force} | ||
| 1027 | Never prompt for confirmation before moving an item. | ||
| 1028 | |||
| 1029 | @item @code{-i}, @code{--interactive} | ||
| 1030 | Prompt for confirmation before moving an item if the target already | ||
| 1031 | exists. | ||
| 1032 | |||
| 1033 | @item @code{-n}, @code{--preview} | ||
| 1034 | Run the command, but don't move anything. This is useful if you | ||
| 1035 | want to preview what would be moved when calling @command{mv}. | ||
| 1036 | |||
| 1037 | @item @code{-v}, @code{--verbose} | ||
| 1038 | Print the name of each item before moving it. | ||
| 1039 | |||
| 1040 | @end table | ||
| 1041 | |||
| 1042 | @item occur @var{regexp} [@var{nlines}] | ||
| 793 | @cmindex occur | 1043 | @cmindex occur |
| 794 | Alias to Emacs's @code{occur}. | 1044 | Alias to Emacs's @code{occur}. |
| 795 | @xref{Other Repeating Search, , , emacs, The GNU Emacs Manual}. | 1045 | @xref{Other Repeating Search, , , emacs, The GNU Emacs Manual}. |
| 796 | 1046 | ||
| 797 | @item popd | 1047 | @item popd |
| 1048 | @item popd +@var{n} | ||
| 798 | @cmindex popd | 1049 | @cmindex popd |
| 799 | Pop a directory from the directory stack and switch to a another place | 1050 | Pop a directory from the directory stack and switch to a another place |
| 800 | in the stack. | 1051 | in the stack. This command can take the following forms: |
| 801 | 1052 | ||
| 802 | @item printnl | 1053 | @table @code |
| 1054 | |||
| 1055 | @item popd | ||
| 1056 | Remove the current directory from the directory stack and change to | ||
| 1057 | the directory beneath it. | ||
| 1058 | |||
| 1059 | @item popd +@var{n} | ||
| 1060 | Remove the current directory from the directory stack and change to | ||
| 1061 | the @var{nth} directory in the stack (counting from zero). | ||
| 1062 | |||
| 1063 | @end table | ||
| 1064 | |||
| 1065 | @item printnl [@var{arg}]@dots{} | ||
| 803 | @cmindex printnl | 1066 | @cmindex printnl |
| 804 | Print the arguments separated by newlines. | 1067 | Print all the @var{arg}s separated by newlines. |
| 805 | 1068 | ||
| 806 | @item pushd | 1069 | @item pushd |
| 1070 | @itemx pushd @var{directory} | ||
| 1071 | @itemx pushd +@var{n} | ||
| 807 | @cmindex pushd | 1072 | @cmindex pushd |
| 808 | Push the current directory onto the directory stack, then change to | 1073 | Push the current directory onto the directory stack, then change to |
| 809 | another directory. | 1074 | another directory. This command can take the following forms: |
| 1075 | |||
| 1076 | @table @code | ||
| 1077 | |||
| 1078 | @vindex eshell-pushd-tohome | ||
| 1079 | @item pushd | ||
| 1080 | Swap the current directory with the directory on the top of the stack. | ||
| 1081 | If @code{eshell-pushd-tohome} is non-@code{nil}, push the current | ||
| 1082 | directory onto the stack and change to the user's home directory (like | ||
| 1083 | @samp{pushd ~}). | ||
| 810 | 1084 | ||
| 811 | @vindex eshell-pushd-dunique | 1085 | @vindex eshell-pushd-dunique |
| 1086 | @item pushd @var{directory} | ||
| 1087 | Push the current directory onto the stack and change to | ||
| 1088 | @var{directory}. If @code{eshell-pushd-dunique} is non-@code{nil}, | ||
| 1089 | then only unique directories will be added to the stack. | ||
| 1090 | |||
| 812 | @vindex eshell-pushd-dextract | 1091 | @vindex eshell-pushd-dextract |
| 813 | If @code{eshell-pushd-dunique} is non-@code{nil}, then only unique | 1092 | @item pushd +@var{n} |
| 814 | directories will be added to the stack. If | 1093 | Change to the @var{nth} directory in the directory stack (counting |
| 815 | @code{eshell-pushd-dextract} is non-@code{nil}, then @samp{pushd | 1094 | from zero), and ``rotate'' the stack by moving any elements before the |
| 816 | +@var{n}} will pop the @var{n}th directory to the top of the stack. | 1095 | @var{nth} to the bottom. If @code{eshell-pushd-dextract} is |
| 1096 | non-@code{nil}, then @samp{pushd +@var{n}} will instead pop the | ||
| 1097 | @var{n}th directory to the top of the stack. | ||
| 1098 | |||
| 1099 | @end table | ||
| 817 | 1100 | ||
| 818 | @item pwd | 1101 | @item pwd |
| 819 | @cmindex pwd | 1102 | @cmindex pwd |
| 820 | Prints the current working directory. | 1103 | Prints the current working directory. |
| 821 | 1104 | ||
| 822 | @item rm | 1105 | @item rm [@var{option}]@dots{} @var{item}@dots{} |
| 823 | @cmindex rm | 1106 | @cmindex rm |
| 824 | Removes files, buffers, processes, or Emacs Lisp symbols, depending on | 1107 | Removes files, buffers, processes, or Emacs Lisp symbols, depending on |
| 825 | the argument. | 1108 | the type of each @var{item}. |
| 826 | 1109 | ||
| 827 | @vindex eshell-rm-interactive-query | 1110 | @vindex eshell-rm-interactive-query |
| 828 | @vindex eshell-rm-removes-directories | 1111 | @vindex eshell-rm-removes-directories |
| @@ -832,56 +1115,84 @@ will prompt before removing anything. If | |||
| 832 | @command{rm} can also remove directories. Otherwise, @command{rmdir} | 1115 | @command{rm} can also remove directories. Otherwise, @command{rmdir} |
| 833 | is required. | 1116 | is required. |
| 834 | 1117 | ||
| 835 | @item rmdir | 1118 | @command{rm} accepts the following options: |
| 1119 | |||
| 1120 | @table @asis | ||
| 1121 | |||
| 1122 | @item @code{-f}, @code{--force} | ||
| 1123 | Never prompt for confirmation before removing an item. | ||
| 1124 | |||
| 1125 | @item @code{-i}, @code{--interactive} | ||
| 1126 | Prompt for confirmation before removing each item. | ||
| 1127 | |||
| 1128 | @item @code{-n}, @code{--preview} | ||
| 1129 | Run the command, but don't remove anything. This is useful if you | ||
| 1130 | want to preview what would be removed when calling @command{rm}. | ||
| 1131 | |||
| 1132 | @item @code{-r}, @code{-R}, @code{--recursive} | ||
| 1133 | Remove any specified directories and their contents recursively. | ||
| 1134 | |||
| 1135 | @item @code{-v}, @code{--verbose} | ||
| 1136 | Print the name of each item before removing it. | ||
| 1137 | |||
| 1138 | @end table | ||
| 1139 | |||
| 1140 | @item rmdir @var{directory}@dots{} | ||
| 836 | @cmindex rmdir | 1141 | @cmindex rmdir |
| 837 | Removes directories if they are empty. | 1142 | Removes directories if they are empty. |
| 838 | 1143 | ||
| 839 | @item set | 1144 | @item set [@var{var} @var{value}]@dots{} |
| 840 | @cmindex set | 1145 | @cmindex set |
| 841 | Set variable values, using the function @code{set} like a command | 1146 | Set variable values, using the function @code{set} like a command |
| 842 | (@pxref{Setting Variables,,, elisp, GNU Emacs Lisp Reference Manual}). | 1147 | (@pxref{Setting Variables,,, elisp, GNU Emacs Lisp Reference Manual}). |
| 843 | A variable name can be a symbol, in which case it refers to a Lisp | 1148 | The value of @var{var} can be a symbol, in which case it refers to a |
| 844 | variable, or a string, referring to an environment variable | 1149 | Lisp variable, or a string, referring to an environment variable |
| 845 | (@pxref{Arguments}). | 1150 | (@pxref{Arguments}). |
| 846 | 1151 | ||
| 847 | @item setq | 1152 | @item setq [@var{symbol} @var{value}]@dots{} |
| 848 | @cmindex setq | 1153 | @cmindex setq |
| 849 | Set variable values, using the function @code{setq} like a command | 1154 | Set variable values, using the function @code{setq} like a command |
| 850 | (@pxref{Setting Variables,,, elisp, GNU Emacs Lisp Reference Manual}). | 1155 | (@pxref{Setting Variables,,, elisp, GNU Emacs Lisp Reference Manual}). |
| 851 | 1156 | ||
| 852 | @item source | 1157 | @item source @var{file} [@var{argument}]@dots{} |
| 853 | @cmindex source | 1158 | @cmindex source |
| 854 | Source an Eshell file in a subshell environment. This is not to be | 1159 | Source an Eshell script named @var{file} in a subshell environment, |
| 855 | confused with the command @command{.}, which sources a file in the | 1160 | passing any @var{argument}s to the script (@pxref{Scripts}). This is |
| 856 | current environment. | 1161 | not to be confused with the command @command{.}, which sources a file |
| 1162 | in the current environment. | ||
| 857 | 1163 | ||
| 858 | @item time | 1164 | @item time @var{command}@dots{} |
| 859 | @cmindex time | 1165 | @cmindex time |
| 860 | Show the time elapsed during a command's execution. | 1166 | Show the time elapsed during the execution of @var{command}. |
| 861 | 1167 | ||
| 862 | @item umask | 1168 | @item umask [-S] |
| 1169 | @itemx umask @var{mode} | ||
| 863 | @cmindex umask | 1170 | @cmindex umask |
| 864 | Set or view the default file permissions for newly created files and | 1171 | View the default file permissions for newly created files and |
| 865 | directories. | 1172 | directories. If you pass @code{-S} or @code{--symbolic}, view the |
| 1173 | mode symbolically. With @var{mode}, set the default permissions to | ||
| 1174 | this value. | ||
| 866 | 1175 | ||
| 867 | @item unset | 1176 | @item unset [@var{var}]@dots{} |
| 868 | @cmindex unset | 1177 | @cmindex unset |
| 869 | Unset one or more variables. As with @command{set}, a variable name | 1178 | Unset one or more variables. As with @command{set}, the value of |
| 870 | can be a symbol, in which case it refers to a Lisp variable, or a | 1179 | @var{var} can be a symbol, in which case it refers to a Lisp variable, |
| 871 | string, referring to an environment variable. | 1180 | or a string, referring to an environment variable. |
| 872 | 1181 | ||
| 873 | @item wait | 1182 | @item wait [@var{process}]@dots{} |
| 874 | @cmindex wait | 1183 | @cmindex wait |
| 875 | Wait until a process has successfully completed. | 1184 | Wait until each specified @var{process} has exited. |
| 876 | 1185 | ||
| 877 | @item which | 1186 | @item which @var{command}@dots{} |
| 878 | @cmindex which | 1187 | @cmindex which |
| 879 | Identify a command and its location. | 1188 | For each @var{command}, identify what kind of command it is and its |
| 1189 | location. | ||
| 880 | 1190 | ||
| 881 | @item whoami | 1191 | @item whoami |
| 882 | @cmindex whoami | 1192 | @cmindex whoami |
| 883 | Print the current user. This Eshell version of @command{whoami} | 1193 | Print the current user. This Eshell version of @command{whoami} is |
| 884 | supports Tramp. | 1194 | connection-aware, so for remote directories, it will print the user |
| 1195 | associated with that connection. | ||
| 885 | @end table | 1196 | @end table |
| 886 | 1197 | ||
| 887 | @subsection Defining new built-in commands | 1198 | @subsection Defining new built-in commands |
| @@ -1353,6 +1664,11 @@ sequence of commands, as with almost any other shell script. Scripts | |||
| 1353 | are invoked from Eshell with @command{source}, or from anywhere in Emacs | 1664 | are invoked from Eshell with @command{source}, or from anywhere in Emacs |
| 1354 | with @code{eshell-source-file}. | 1665 | with @code{eshell-source-file}. |
| 1355 | 1666 | ||
| 1667 | Like with aliases (@pxref{Aliases}), Eshell scripts can accept any | ||
| 1668 | number of arguments. Within the script, you can refer to these with | ||
| 1669 | the special variables @code{$0}, @code{$1}, @dots{}, @code{$9}, and | ||
| 1670 | @code{$*}. | ||
| 1671 | |||
| 1356 | @cmindex . | 1672 | @cmindex . |
| 1357 | If you wish to load a script into your @emph{current} environment, | 1673 | If you wish to load a script into your @emph{current} environment, |
| 1358 | rather than in a subshell, use the @code{.} command. | 1674 | rather than in a subshell, use the @code{.} command. |
| @@ -1452,7 +1768,7 @@ As with @samp{$@{@var{command}@}}, evaluates the Eshell command invocation | |||
| 1452 | @command{@var{command}}, but writes the output to a temporary file and | 1768 | @command{@var{command}}, but writes the output to a temporary file and |
| 1453 | returns the file name. | 1769 | returns the file name. |
| 1454 | 1770 | ||
| 1455 | @item $@var{expr}[@var{i...}] | 1771 | @item $@var{expr}[@var{i@dots{}}] |
| 1456 | Expands to the @var{i}th element of the result of @var{expr}, an | 1772 | Expands to the @var{i}th element of the result of @var{expr}, an |
| 1457 | expression in one of the above forms listed here. If multiple indices | 1773 | expression in one of the above forms listed here. If multiple indices |
| 1458 | are supplied, this will return a list containing the elements for each | 1774 | are supplied, this will return a list containing the elements for each |
| @@ -1501,7 +1817,7 @@ Multiple sets of indices can also be specified. For example, if | |||
| 1501 | expand to @code{2}, i.e.@: the second element of the first list member | 1817 | expand to @code{2}, i.e.@: the second element of the first list member |
| 1502 | (all indices are zero-based). | 1818 | (all indices are zero-based). |
| 1503 | 1819 | ||
| 1504 | @item $@var{expr}[@var{regexp} @var{i...}] | 1820 | @item $@var{expr}[@var{regexp} @var{i@dots{}}] |
| 1505 | As above (when @var{expr} expands to a string), but use @var{regexp} | 1821 | As above (when @var{expr} expands to a string), but use @var{regexp} |
| 1506 | to split the string. @var{regexp} can be any form other than a | 1822 | to split the string. @var{regexp} can be any form other than a |
| 1507 | number. For example, @samp{$@var{var}[: 0]} will return the first | 1823 | number. For example, @samp{$@var{var}[: 0]} will return the first |
| @@ -2275,15 +2591,23 @@ external commands. To enable it, add @code{eshell-tramp} to | |||
| 2275 | 2591 | ||
| 2276 | @table @code | 2592 | @table @code |
| 2277 | 2593 | ||
| 2278 | @item su | 2594 | @item su [- | -l] [@var{user}] |
| 2279 | @cmindex su | 2595 | @cmindex su |
| 2280 | @itemx sudo | 2596 | Uses TRAMP's @command{su} method (@pxref{Inline methods, , , tramp, |
| 2597 | The Tramp Manual}) to change the current user to @var{user} (or root | ||
| 2598 | if unspecified). With @code{-}, @code{-l}, or @code{--login}, provide | ||
| 2599 | a login environment. | ||
| 2600 | |||
| 2601 | @item sudo [-u @var{user}] [-s | @var{command}@dots{}] | ||
| 2281 | @cmindex sudo | 2602 | @cmindex sudo |
| 2282 | @itemx doas | 2603 | @itemx doas [-u @var{user}] [-s | @var{command}@dots{}] |
| 2283 | @cmindex doas | 2604 | @cmindex doas |
| 2284 | Uses TRAMP's @command{su}, @command{sudo}, or @command{doas} method | 2605 | Uses TRAMP's @command{sudo} or @command{doas} method (@pxref{Inline |
| 2285 | (@pxref{Inline methods, , , tramp, The Tramp Manual}) to run a command | 2606 | methods, , , tramp, The Tramp Manual}) to run @var{command} as root |
| 2286 | via @command{su}, @command{sudo}, or @command{doas}. | 2607 | via @command{sudo} or @command{doas}. When specifying @code{-u |
| 2608 | @var{user}} or @code{--user @var{user}}, run the command as @var{user} | ||
| 2609 | instead. With @code{-s} or @code{--shell}, start a shell instead of | ||
| 2610 | running @var{command}. | ||
| 2287 | 2611 | ||
| 2288 | @end table | 2612 | @end table |
| 2289 | 2613 | ||
| @@ -2296,58 +2620,58 @@ add @code{eshell-xtra} to @code{eshell-modules-list}. | |||
| 2296 | 2620 | ||
| 2297 | @table @code | 2621 | @table @code |
| 2298 | 2622 | ||
| 2299 | @item count | 2623 | @item count @var{item} @var{seq} [@var{option}]@dots{} |
| 2300 | @cmindex count | 2624 | @cmindex count |
| 2301 | A wrapper around the function @code{cl-count} (@pxref{Searching | 2625 | A wrapper around the function @code{cl-count} (@pxref{Searching |
| 2302 | Sequences,,, cl, GNU Emacs Common Lisp Emulation}). This command can | 2626 | Sequences,,, cl, GNU Emacs Common Lisp Emulation}). This command can |
| 2303 | be used for comparing lists of strings. | 2627 | be used for comparing lists of strings. |
| 2304 | 2628 | ||
| 2305 | @item expr | 2629 | @item expr @var{str} [@var{separator}] [@var{arg}]@dots{} |
| 2306 | @cmindex expr | 2630 | @cmindex expr |
| 2307 | An implementation of @command{expr} using the Calc package. | 2631 | An implementation of @command{expr} using the Calc package. |
| 2308 | @xref{Top,,, calc, The GNU Emacs Calculator}. | 2632 | @xref{Top,,, calc, The GNU Emacs Calculator}. |
| 2309 | 2633 | ||
| 2310 | @item ff | 2634 | @item ff @var{directory} @var{pattern} |
| 2311 | @cmindex ff | 2635 | @cmindex ff |
| 2312 | Shorthand for the the function @code{find-name-dired} (@pxref{Dired | 2636 | Shorthand for the the function @code{find-name-dired} (@pxref{Dired |
| 2313 | and Find, , , emacs, The Emacs Editor}). | 2637 | and Find, , , emacs, The Emacs Editor}). |
| 2314 | 2638 | ||
| 2315 | @item gf | 2639 | @item gf @var{directory} @var{regexp} |
| 2316 | @cmindex gf | 2640 | @cmindex gf |
| 2317 | Shorthand for the the function @code{find-grep-dired} (@pxref{Dired | 2641 | Shorthand for the the function @code{find-grep-dired} (@pxref{Dired |
| 2318 | and Find, , , emacs, The Emacs Editor}). | 2642 | and Find, , , emacs, The Emacs Editor}). |
| 2319 | 2643 | ||
| 2320 | @item intersection | 2644 | @item intersection @var{list1} @var{list2} [@var{option}]@dots{} |
| 2321 | @cmindex intersection | 2645 | @cmindex intersection |
| 2322 | A wrapper around the function @code{cl-intersection} (@pxref{Lists as | 2646 | A wrapper around the function @code{cl-intersection} (@pxref{Lists as |
| 2323 | Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command | 2647 | Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command |
| 2324 | can be used for comparing lists of strings. | 2648 | can be used for comparing lists of strings. |
| 2325 | 2649 | ||
| 2326 | @item mismatch | 2650 | @item mismatch @var{seq1} @var{seq2} [@var{option}]@dots{} |
| 2327 | @cmindex mismatch | 2651 | @cmindex mismatch |
| 2328 | A wrapper around the function @code{cl-mismatch} (@pxref{Searching | 2652 | A wrapper around the function @code{cl-mismatch} (@pxref{Searching |
| 2329 | Sequences,,, cl, GNU Emacs Common Lisp Emulation}). This command can | 2653 | Sequences,,, cl, GNU Emacs Common Lisp Emulation}). This command can |
| 2330 | be used for comparing lists of strings. | 2654 | be used for comparing lists of strings. |
| 2331 | 2655 | ||
| 2332 | @item set-difference | 2656 | @item set-difference @var{list1} @var{list2} [@var{option}]@dots{} |
| 2333 | @cmindex set-difference | 2657 | @cmindex set-difference |
| 2334 | A wrapper around the function @code{cl-set-difference} (@pxref{Lists | 2658 | A wrapper around the function @code{cl-set-difference} (@pxref{Lists |
| 2335 | as Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command can be | 2659 | as Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command can be |
| 2336 | used for comparing lists of strings. | 2660 | used for comparing lists of strings. |
| 2337 | 2661 | ||
| 2338 | @item set-exclusive-or | 2662 | @item set-exclusive-or @var{list1} @var{list2} [@var{option}]@dots{} |
| 2339 | @cmindex set-exclusive-or | 2663 | @cmindex set-exclusive-or |
| 2340 | A wrapper around the function @code{cl-set-exclusive-or} (@pxref{Lists | 2664 | A wrapper around the function @code{cl-set-exclusive-or} (@pxref{Lists |
| 2341 | as Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command can be | 2665 | as Sets,,, cl, GNU Emacs Common Lisp Emulation}). This command can be |
| 2342 | used for comparing lists of strings. | 2666 | used for comparing lists of strings. |
| 2343 | 2667 | ||
| 2344 | @item substitute | 2668 | @item substitute @var{new} @var{old} @var{seq} [@var{option}]@dots{} |
| 2345 | @cmindex substitute | 2669 | @cmindex substitute |
| 2346 | A wrapper around the function @code{cl-substitute} (@pxref{Sequence | 2670 | A wrapper around the function @code{cl-substitute} (@pxref{Sequence |
| 2347 | Functions,,, cl, GNU Emacs Common Lisp Emulation}). This command can | 2671 | Functions,,, cl, GNU Emacs Common Lisp Emulation}). This command can |
| 2348 | be used for comparing lists of strings. | 2672 | be used for comparing lists of strings. |
| 2349 | 2673 | ||
| 2350 | @item union | 2674 | @item union @var{list1} @var{list2} [@var{option}]@dots{} |
| 2351 | @cmindex union | 2675 | @cmindex union |
| 2352 | A wrapper around the function @code{cl-union} (@pxref{Lists as Sets,,, | 2676 | A wrapper around the function @code{cl-union} (@pxref{Lists as Sets,,, |
| 2353 | cl, GNU Emacs Common Lisp Emulation}). This command can be used for | 2677 | cl, GNU Emacs Common Lisp Emulation}). This command can be used for |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 78dfd0654e2..23028576f45 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -618,11 +618,11 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.") | |||
| 618 | :preserve-args | 618 | :preserve-args |
| 619 | :external "ln" | 619 | :external "ln" |
| 620 | :show-usage | 620 | :show-usage |
| 621 | :usage "[OPTION]... TARGET [LINK_NAME] | 621 | :usage "[OPTION]... TARGET LINK_NAME |
| 622 | or: ln [OPTION]... TARGET... DIRECTORY | 622 | or: ln [OPTION]... TARGET... DIRECTORY |
| 623 | Create a link to the specified TARGET with optional LINK_NAME. If there is | 623 | Create a link to the specified TARGET with LINK_NAME. If there is more |
| 624 | more than one TARGET, the last argument must be a directory; create links | 624 | than one TARGET, the last argument must be a directory; create links in |
| 625 | in DIRECTORY to each TARGET. Create hard links by default, symbolic links | 625 | DIRECTORY to each TARGET. Create hard links by default, symbolic links |
| 626 | with `--symbolic'. When creating hard links, each TARGET must exist.") | 626 | with `--symbolic'. When creating hard links, each TARGET must exist.") |
| 627 | (let ((no-dereference t)) | 627 | (let ((no-dereference t)) |
| 628 | (eshell-mvcpln-template "ln" "linking" | 628 | (eshell-mvcpln-template "ln" "linking" |
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index dc2b93e574b..44861c222b8 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el | |||
| @@ -253,10 +253,10 @@ An external command simply means external to Emacs." | |||
| 253 | "Add a set of paths to PATH." | 253 | "Add a set of paths to PATH." |
| 254 | (eshell-eval-using-options | 254 | (eshell-eval-using-options |
| 255 | "addpath" args | 255 | "addpath" args |
| 256 | '((?b "begin" nil prepend "add path element at beginning") | 256 | '((?b "begin" nil prepend "add to beginning of $PATH") |
| 257 | (?h "help" nil nil "display this usage message") | 257 | (?h "help" nil nil "display this usage message") |
| 258 | :usage "[-b] PATH | 258 | :usage "[-b] DIR... |
| 259 | Adds the given PATH to $PATH.") | 259 | Adds the given DIR to $PATH.") |
| 260 | (let ((path (eshell-get-path t))) | 260 | (let ((path (eshell-get-path t))) |
| 261 | (if args | 261 | (if args |
| 262 | (progn | 262 | (progn |
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 537bc4b0641..02b5c785625 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el | |||
| @@ -433,7 +433,7 @@ the values of nil for each." | |||
| 433 | (?h "help" nil nil "show this usage screen") | 433 | (?h "help" nil nil "show this usage screen") |
| 434 | :external "env" | 434 | :external "env" |
| 435 | :parse-leading-options-only | 435 | :parse-leading-options-only |
| 436 | :usage "[NAME=VALUE]... [COMMAND [ARG]...]") | 436 | :usage "[NAME=VALUE]... [COMMAND]...") |
| 437 | (if args | 437 | (if args |
| 438 | (or (eshell-parse-local-variables args) | 438 | (or (eshell-parse-local-variables args) |
| 439 | (eshell-named-command (car args) (cdr args))) | 439 | (eshell-named-command (car args) (cdr args))) |