FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-patterns/append_output.sh at master · botdigit/python-patterns · GitHub
botdigit
/
python-patterns
Public
forked from
faif/python-patterns
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-patterns
/
append_output.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
19 lines (14 loc) · 431 Bytes
Breadcrumbs
python-patterns
/
append_output.sh
Copy path
File metadata and controls
executable file
·
19 lines (14 loc) · 431 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!
/bin/bash
#
This script (given path to a python script as an argument)
#
appends python outputs to given file.
set
-e
output_marker=
'
OUTPUT = """
'
#
get everything (excluding part between `output_marker` and the end of the file)
#
into `src` var
src=
$(
sed -n -e
"
/
$output_marker
/,
\$
!p
"
"
$1
"
)
output=
$(
python
"
$1
"
)
echo
"
$src
"
>
$1
echo
-e
"
\n
"
>>
$1
echo
"
$output_marker
"
>>
$1
echo
"
$output
"
>>
$1
echo
'
""" # noqa
'
>>
$1
Back
|
FazBrowse Home
|
New Git URL