sed: -e expression #1, char 1: unknown command: '|'

Mario Palumbo

When i put this code in terminal:

sed -i "|^if [[ -f /etc/skel/.bashrc ]]; then . /etc/skel/.bashrc; fi|d" ~/.bashrc

I obtain:

sed: -e expression #1, char 1: unknown command: '|'

Why?

schrodigerscatcuriosity

You have to indicate that you are using a different separator in sed delete command by prepending a backslash \ before the new separator:

sed '\|text|d' file

See selecting lines by text matching in GNU Sed manual.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

sed: -e expression #1, char 23: unknown option to `s'

From Dev

unknown command ':1' haskell

From Dev

sed unknown command on windows cmd

From Dev

understand Regular expression in a sed command

From Dev

mysql 5.7 -e option get error at line 1: unknown command '\u'

From Dev

sed: -e expression #1, char 4: unknown command:

From Dev

sed unknown command on windows cmd

From Dev

sed throwing sed: -e expression #(number), char (number): unknown command: `(letter)'

From Dev

bash - sed: -e expression #1, char 15: unterminated `s' command

From Dev

Getting "sed: -e expression #1" when trying to run search and replace

From Dev

sed throwing sed: -e expression #(number), char (number): unknown command: `(letter)'

From Dev

sed: -e expression #1, char 44: unterminated address regex

From Dev

sed command with regular expression

From Dev

Why does sed output -e expression #1, char 55: Invalid preceding regular expression

From Dev

sed: -e expression #1, char 35: unterminated `s' command

From Dev

sed: -e expression #1, char 1: unknown command: `''

From Dev

sed: -e expression #1, char 37: unterminated `s' command

From Dev

sed: -e expression #1, char 3: unexpected `,'

From Dev

sed in bash script: unknown command: `''`

From Dev

what is this sed command doing: sed '1!G;h'

From Dev

sed: -e expression #1, char 10: missing command

From Dev

/bin/sed: -e expression #1, char 56: unknown option to `s'

From Dev

sed: -e expression #3, char 59: unknown option to `s'

From Dev

`sed: -e expression #1, char 4: unknown command:` but the line endings are fine

From Dev

sed Error sed: -e expression #1, char 7: unterminated `s' command

From Dev

bash sed: -e expression #1, char 21: number option to `s' command may not be zero

From Dev

sed: -e expression #1, char 10: extra characters after command

From Dev

sed: -e expression #1, char XX: unterminated `s' command

From Dev

sed: -e expression #1, char 5: unterminated `s' command

Related Related

  1. 1

    sed: -e expression #1, char 23: unknown option to `s'

  2. 2

    unknown command ':1' haskell

  3. 3

    sed unknown command on windows cmd

  4. 4

    understand Regular expression in a sed command

  5. 5

    mysql 5.7 -e option get error at line 1: unknown command '\u'

  6. 6

    sed: -e expression #1, char 4: unknown command:

  7. 7

    sed unknown command on windows cmd

  8. 8

    sed throwing sed: -e expression #(number), char (number): unknown command: `(letter)'

  9. 9

    bash - sed: -e expression #1, char 15: unterminated `s' command

  10. 10

    Getting "sed: -e expression #1" when trying to run search and replace

  11. 11

    sed throwing sed: -e expression #(number), char (number): unknown command: `(letter)'

  12. 12

    sed: -e expression #1, char 44: unterminated address regex

  13. 13

    sed command with regular expression

  14. 14

    Why does sed output -e expression #1, char 55: Invalid preceding regular expression

  15. 15

    sed: -e expression #1, char 35: unterminated `s' command

  16. 16

    sed: -e expression #1, char 1: unknown command: `''

  17. 17

    sed: -e expression #1, char 37: unterminated `s' command

  18. 18

    sed: -e expression #1, char 3: unexpected `,'

  19. 19

    sed in bash script: unknown command: `''`

  20. 20

    what is this sed command doing: sed '1!G;h'

  21. 21

    sed: -e expression #1, char 10: missing command

  22. 22

    /bin/sed: -e expression #1, char 56: unknown option to `s'

  23. 23

    sed: -e expression #3, char 59: unknown option to `s'

  24. 24

    `sed: -e expression #1, char 4: unknown command:` but the line endings are fine

  25. 25

    sed Error sed: -e expression #1, char 7: unterminated `s' command

  26. 26

    bash sed: -e expression #1, char 21: number option to `s' command may not be zero

  27. 27

    sed: -e expression #1, char 10: extra characters after command

  28. 28

    sed: -e expression #1, char XX: unterminated `s' command

  29. 29

    sed: -e expression #1, char 5: unterminated `s' command

HotTag

Archive