Execute a block of commands without keeping it in shell history (zsh)

CMCDragonkai

I know you can avoid keeping the command in history if you use setopt HIST_IGNORE_SPACE. But what about a block of commands?

Imagine I write something like:

nohistorystart
...cmds...
nohistoryend

Or something that starts a prompt.

Joshua Goldberg

From this answer, you can push/pop a new history, not associated with a save file. (Note the capitals.)

fc -p 
...cmds...
fc -P

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to execute mongo commands through shell scripts?

From Dev

Execute a range of commands from history

From Dev

Cannot execute shell commands in bash script

From Dev

Shell out into zsh and execute commands from bash script

From Dev

Jenkins - Block "Execute shell"

From Dev

how to commit file without keeping modification history on svn

From Dev

pass multiple commands for cmd to execute as one block

From Dev

Jenkins - Execute shell commands with wildcards

From Dev

Clojure: how to execute shell commands with piping?

From Dev

How to remove unknown commands from shell terminal history (zsh)

From Dev

Jenkins - can the "Execute Shell" execute SSH commands

From Dev

Share history in multiple zsh shell

From Dev

execute commands as parameters in a login shell

From Dev

Is there any way to execute commands from history?

From Dev

Execute a python script without the shell

From Dev

Execute shell commands in Python

From Dev

Is there a way to show the history of the commands used in the shell?

From Dev

How to execute consecutive commands from history?

From Dev

Keeping history per working directory (cf. per shell session)

From Dev

How to draw a line between commands in zsh shell

From Dev

Cannot execute shell /bin/zsh when execute a shell command in vi

From Dev

zsh history: comment out dangerous commands: `#`

From Dev

How to run encryption commands on linux without shell history logging

From Dev

Execute a block of commands without keeping it in shell history (zsh)

From Dev

Archive history without exiting the shell

From Dev

Execute history or fc from script or non-interactive zsh instance

From Dev

Execute a shell script without `./`

From Dev

ZSH avoid adding empty commands to history?

From Dev

Python Execute Shell commands without having a terminal open

Related Related

  1. 1

    How to execute mongo commands through shell scripts?

  2. 2

    Execute a range of commands from history

  3. 3

    Cannot execute shell commands in bash script

  4. 4

    Shell out into zsh and execute commands from bash script

  5. 5

    Jenkins - Block "Execute shell"

  6. 6

    how to commit file without keeping modification history on svn

  7. 7

    pass multiple commands for cmd to execute as one block

  8. 8

    Jenkins - Execute shell commands with wildcards

  9. 9

    Clojure: how to execute shell commands with piping?

  10. 10

    How to remove unknown commands from shell terminal history (zsh)

  11. 11

    Jenkins - can the "Execute Shell" execute SSH commands

  12. 12

    Share history in multiple zsh shell

  13. 13

    execute commands as parameters in a login shell

  14. 14

    Is there any way to execute commands from history?

  15. 15

    Execute a python script without the shell

  16. 16

    Execute shell commands in Python

  17. 17

    Is there a way to show the history of the commands used in the shell?

  18. 18

    How to execute consecutive commands from history?

  19. 19

    Keeping history per working directory (cf. per shell session)

  20. 20

    How to draw a line between commands in zsh shell

  21. 21

    Cannot execute shell /bin/zsh when execute a shell command in vi

  22. 22

    zsh history: comment out dangerous commands: `#`

  23. 23

    How to run encryption commands on linux without shell history logging

  24. 24

    Execute a block of commands without keeping it in shell history (zsh)

  25. 25

    Archive history without exiting the shell

  26. 26

    Execute history or fc from script or non-interactive zsh instance

  27. 27

    Execute a shell script without `./`

  28. 28

    ZSH avoid adding empty commands to history?

  29. 29

    Python Execute Shell commands without having a terminal open

HotTag

Archive