Bash: more than one command line substitution

Vihaan Verma
$touch file{1,2}
$echo "file1" >>  file1
$^1^2
=>echo "file2">>file1

But I wanted it to be

echo "file2">>file2

How to do more than one substitution ?

William Pursell
!!:gs/1/2

should do it. ^1^2 is a shortcut for !!:s/1/2, and you just need to supply the g flag.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bash: more than one command line substitution

From Dev

Bash Script execute more than one command

From Dev

Java exec command prompt more than one line of command

From Dev

PostgreSQL COPY command - how to write query in more than one line

From Dev

PostgreSQL COPY command - how to write query in more than one line

From Dev

for loop in bash to get more than 1 variables to use it in one command

From Dev

read more than one parameters right after the command in bash

From Dev

sbt how to pass command line parameters when more than one executable

From Dev

How to specify more than one include directories for setup.py from command line?

From Dev

Adding more than one image as album art to mp3 via command line

From Dev

How to specify more than one include directories for setup.py from command line?

From Dev

Running more than one command with xargs

From Dev

Sort command on more than one field

From Dev

Detect if a div has more than one line

From Dev

inputType="number" with more than one line

From Dev

Grep more than one string in a single line

From Dev

sed print more than one matches in a line

From Dev

Detect if a div has more than one line

From Dev

Printing more than one line after a match

From Dev

Grep more than one string in a single line

From Dev

Byte string spanning more than one line

From Dev

Bash Parameter Substitution: command line vs. script

From Dev

Use more than one core in bash

From Dev

Redirect the output of one command to more than one command

From Dev

Bash Command Substitution to an Array

From Dev

Command Substitution in Bash for tty

From Dev

Bash: Quotation in command substitution

From Dev

Is it possible to redirect the output of a command into more than one command?

From Dev

In bash, feed output of one command line-by-line into another command

Related Related

  1. 1

    Bash: more than one command line substitution

  2. 2

    Bash Script execute more than one command

  3. 3

    Java exec command prompt more than one line of command

  4. 4

    PostgreSQL COPY command - how to write query in more than one line

  5. 5

    PostgreSQL COPY command - how to write query in more than one line

  6. 6

    for loop in bash to get more than 1 variables to use it in one command

  7. 7

    read more than one parameters right after the command in bash

  8. 8

    sbt how to pass command line parameters when more than one executable

  9. 9

    How to specify more than one include directories for setup.py from command line?

  10. 10

    Adding more than one image as album art to mp3 via command line

  11. 11

    How to specify more than one include directories for setup.py from command line?

  12. 12

    Running more than one command with xargs

  13. 13

    Sort command on more than one field

  14. 14

    Detect if a div has more than one line

  15. 15

    inputType="number" with more than one line

  16. 16

    Grep more than one string in a single line

  17. 17

    sed print more than one matches in a line

  18. 18

    Detect if a div has more than one line

  19. 19

    Printing more than one line after a match

  20. 20

    Grep more than one string in a single line

  21. 21

    Byte string spanning more than one line

  22. 22

    Bash Parameter Substitution: command line vs. script

  23. 23

    Use more than one core in bash

  24. 24

    Redirect the output of one command to more than one command

  25. 25

    Bash Command Substitution to an Array

  26. 26

    Command Substitution in Bash for tty

  27. 27

    Bash: Quotation in command substitution

  28. 28

    Is it possible to redirect the output of a command into more than one command?

  29. 29

    In bash, feed output of one command line-by-line into another command

HotTag

Archive