Split IPython Magic Shell Multiple Lines

bkmoney

I am trying to run a very long shell command in IPython using the ! operator. How do I split the command onto multiple lines?

For instance,

 !awk -v c=0 '{{if (a[$$1]) print $$0 a[$$1]; else if (b[$$2]) print $$0 b[$$2] else {{print $$0 " common_" c; a[$$1] = b[$$2] = " common_" c; c++}}}}' foo.txt | column -t

A command like this quickly becomes unreadable.

Jan Vlcinsky

Use \, press enter, continue typing, use another \ and enter until you are done.

E.g.

In [1]: !ls \
   ...: *.txt
aws-forum.txt  encyclic.txt

In [2]: 

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Split according to ":" in multiple lines

From Dev

Vim editor - zsh shell ipython magic %ed cannot find editor

From Dev

Vim editor - zsh shell ipython magic %ed cannot find editor

From Java

How can I split a shell command over multiple lines when using an IF statement?

From Dev

Split the title onto multiple lines?

From Dev

Reading multiple lines in Bourne Shell

From Dev

Ignore IPython magic in python

From Java

Swift - Split string over multiple lines

From Dev

Python: split method call into multiple lines

From Dev

XSLT to split text data into group of multiple lines

From Dev

How to split a line of code into multiple lines?

From Dev

Split python regex code into multiple lines

From Dev

Split long string constant in multiple lines

From Dev

Split long jade array variable into multiple lines

From Dev

How to split long sed expression into multiple lines?

From Dev

android studio split code over multiple lines

From Dev

How to split a longer formula into multiple lines with PHP?

From Dev

How to split a sed command into multiple lines

From Dev

Split a long grep pattern into multiple lines

From Dev

How to split awk output to multiple lines for piping

From Java

How do I comment out multiple lines in Jupyter Ipython notebook?

From Dev

python vim tmux linux - copy multiple lines from vim to ipython

From Dev

How to match & then replace multiple lines in shell script

From Dev

Shell, bash : grep the html tag in multiple lines

From Dev

Replace multiple lines of file in Shell with variable

From Dev

Reading multiple lines user input in Shell

From Dev

How to match & then replace multiple lines in shell script

From Dev

Memory address of ipython magic functions

From Dev

Pipe Ipython magic output to a variable?

Related Related

  1. 1

    Split according to ":" in multiple lines

  2. 2

    Vim editor - zsh shell ipython magic %ed cannot find editor

  3. 3

    Vim editor - zsh shell ipython magic %ed cannot find editor

  4. 4

    How can I split a shell command over multiple lines when using an IF statement?

  5. 5

    Split the title onto multiple lines?

  6. 6

    Reading multiple lines in Bourne Shell

  7. 7

    Ignore IPython magic in python

  8. 8

    Swift - Split string over multiple lines

  9. 9

    Python: split method call into multiple lines

  10. 10

    XSLT to split text data into group of multiple lines

  11. 11

    How to split a line of code into multiple lines?

  12. 12

    Split python regex code into multiple lines

  13. 13

    Split long string constant in multiple lines

  14. 14

    Split long jade array variable into multiple lines

  15. 15

    How to split long sed expression into multiple lines?

  16. 16

    android studio split code over multiple lines

  17. 17

    How to split a longer formula into multiple lines with PHP?

  18. 18

    How to split a sed command into multiple lines

  19. 19

    Split a long grep pattern into multiple lines

  20. 20

    How to split awk output to multiple lines for piping

  21. 21

    How do I comment out multiple lines in Jupyter Ipython notebook?

  22. 22

    python vim tmux linux - copy multiple lines from vim to ipython

  23. 23

    How to match & then replace multiple lines in shell script

  24. 24

    Shell, bash : grep the html tag in multiple lines

  25. 25

    Replace multiple lines of file in Shell with variable

  26. 26

    Reading multiple lines user input in Shell

  27. 27

    How to match & then replace multiple lines in shell script

  28. 28

    Memory address of ipython magic functions

  29. 29

    Pipe Ipython magic output to a variable?

HotTag

Archive