Replace the opening ``` of double ``` pairs with ```bash
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a markdown file which contain code blocks as
In [310]: !cat data.md
**File Permission Related Commands**
These commands are used to change permissions of the files
```
72. chmod octal file-name : Changes the permissions of file to octal
chmod 777 /data/test.c : Sets rwx permission for owner , group and others
```
**Network Related Commands**
These commands are used to view and edit network configurations related aspects of the system
```
75. ifconfig -a : Displays all network interface and set ip address
76. ifconfig eth0 : Displays eth0 ethernet port ip address and details
```
**Compression / Archive Related Commands**
These commands are used to compress and decompress files
```
89. tar cf home.tar home : Creates a tar named home.tar containing home/
tar xf file.tar : Extracts the files from file.tar
tar czf file.tar.gz files : Creates a tar with gzip compression
I'd like to replace the opening (triple cavet) with
bash to mark the shell script which will be demonstrated in color by the editor.
I tried
In [311]: !sed "s/^(```)/(```bash)/g"
/usr/local/bin/bash: command substitution: line 0: syntax error near unexpected token `)'
/usr/local/bin/bash: command substitution: line 0: `)/('
sed: -e expression #1, char 11: unterminated `s' command
In [316]: !sed -E "s/^```/```bash/g"
/usr/local/bin/bash: /: Is a directory
sed: -e expression #1, char 9: unterminated `s' command
also other alternatives.
How could I accomplish such a task?
bash
add a comment |Â
up vote
0
down vote
favorite
I have a markdown file which contain code blocks as
In [310]: !cat data.md
**File Permission Related Commands**
These commands are used to change permissions of the files
```
72. chmod octal file-name : Changes the permissions of file to octal
chmod 777 /data/test.c : Sets rwx permission for owner , group and others
```
**Network Related Commands**
These commands are used to view and edit network configurations related aspects of the system
```
75. ifconfig -a : Displays all network interface and set ip address
76. ifconfig eth0 : Displays eth0 ethernet port ip address and details
```
**Compression / Archive Related Commands**
These commands are used to compress and decompress files
```
89. tar cf home.tar home : Creates a tar named home.tar containing home/
tar xf file.tar : Extracts the files from file.tar
tar czf file.tar.gz files : Creates a tar with gzip compression
I'd like to replace the opening (triple cavet) with
bash to mark the shell script which will be demonstrated in color by the editor.
I tried
In [311]: !sed "s/^(```)/(```bash)/g"
/usr/local/bin/bash: command substitution: line 0: syntax error near unexpected token `)'
/usr/local/bin/bash: command substitution: line 0: `)/('
sed: -e expression #1, char 11: unterminated `s' command
In [316]: !sed -E "s/^```/```bash/g"
/usr/local/bin/bash: /: Is a directory
sed: -e expression #1, char 9: unterminated `s' command
also other alternatives.
How could I accomplish such a task?
bash
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a markdown file which contain code blocks as
In [310]: !cat data.md
**File Permission Related Commands**
These commands are used to change permissions of the files
```
72. chmod octal file-name : Changes the permissions of file to octal
chmod 777 /data/test.c : Sets rwx permission for owner , group and others
```
**Network Related Commands**
These commands are used to view and edit network configurations related aspects of the system
```
75. ifconfig -a : Displays all network interface and set ip address
76. ifconfig eth0 : Displays eth0 ethernet port ip address and details
```
**Compression / Archive Related Commands**
These commands are used to compress and decompress files
```
89. tar cf home.tar home : Creates a tar named home.tar containing home/
tar xf file.tar : Extracts the files from file.tar
tar czf file.tar.gz files : Creates a tar with gzip compression
I'd like to replace the opening (triple cavet) with
bash to mark the shell script which will be demonstrated in color by the editor.
I tried
In [311]: !sed "s/^(```)/(```bash)/g"
/usr/local/bin/bash: command substitution: line 0: syntax error near unexpected token `)'
/usr/local/bin/bash: command substitution: line 0: `)/('
sed: -e expression #1, char 11: unterminated `s' command
In [316]: !sed -E "s/^```/```bash/g"
/usr/local/bin/bash: /: Is a directory
sed: -e expression #1, char 9: unterminated `s' command
also other alternatives.
How could I accomplish such a task?
bash
I have a markdown file which contain code blocks as
In [310]: !cat data.md
**File Permission Related Commands**
These commands are used to change permissions of the files
```
72. chmod octal file-name : Changes the permissions of file to octal
chmod 777 /data/test.c : Sets rwx permission for owner , group and others
```
**Network Related Commands**
These commands are used to view and edit network configurations related aspects of the system
```
75. ifconfig -a : Displays all network interface and set ip address
76. ifconfig eth0 : Displays eth0 ethernet port ip address and details
```
**Compression / Archive Related Commands**
These commands are used to compress and decompress files
```
89. tar cf home.tar home : Creates a tar named home.tar containing home/
tar xf file.tar : Extracts the files from file.tar
tar czf file.tar.gz files : Creates a tar with gzip compression
I'd like to replace the opening (triple cavet) with
bash to mark the shell script which will be demonstrated in color by the editor.
I tried
In [311]: !sed "s/^(```)/(```bash)/g"
/usr/local/bin/bash: command substitution: line 0: syntax error near unexpected token `)'
/usr/local/bin/bash: command substitution: line 0: `)/('
sed: -e expression #1, char 11: unterminated `s' command
In [316]: !sed -E "s/^```/```bash/g"
/usr/local/bin/bash: /: Is a directory
sed: -e expression #1, char 9: unterminated `s' command
also other alternatives.
How could I accomplish such a task?
bash
bash
asked 4 mins ago
Sawajiri
3056
3056
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479835%2freplace-the-opening-of-double-pairs-with-bash%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password