diff options
author | typebrook <typebrook@gmail.com> | 2020-05-31 22:32:37 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-31 22:32:37 +0800 |
commit | 88e0fbc0d29468f759d9802625088c1e067f08fa (patch) | |
tree | 5cf56cecf185d1d4824f77e858f1a117855a57ca | |
parent | 6b517348525566a2702a8678808e86880613eb53 (diff) |
Apply file as argument of tac
-rwxr-xr-x | gist | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -436,7 +436,7 @@ _update_gists() { | |||
436 | extra="s0 True https://gist.github.com/b0d2e7e67aa50298fdf8111ae7466b56 #bash,#gist NONE README.md@Markdown,gist@Shell 2 30 typebrook 2019-12-26T06:49:40Z 2020-05-15T13:00:31Z [bash-gist] A bash script for gist management" | 436 | extra="s0 True https://gist.github.com/b0d2e7e67aa50298fdf8111ae7466b56 #bash,#gist NONE README.md@Markdown,gist@Shell 2 30 typebrook 2019-12-26T06:49:40Z 2020-05-15T13:00:31Z [bash-gist] A bash script for gist management" |
437 | [[ $mark == s ]] && echo $extra >> $INDEX | 437 | [[ $mark == s ]] && echo $extra >> $INDEX |
438 | 438 | ||
439 | tac <$fetched_records | nl -s' ' \ | 439 | tac $fetched_records | nl -s' ' \ |
440 | | while read -r "${INDEX_FORMAT[@]:0:2}" extra; do | 440 | | while read -r "${INDEX_FORMAT[@]:0:2}" extra; do |
441 | local prefix='' | 441 | local prefix='' |
442 | [[ $public == False ]] && prefix=p; [[ $mark == s ]] && prefix=s | 442 | [[ $public == False ]] && prefix=p; [[ $mark == s ]] && prefix=s |
@@ -452,7 +452,7 @@ _update_gists() { | |||
452 | _query_user() { | 452 | _query_user() { |
453 | local fetched_records=$(tmp_file fetched) | 453 | local fetched_records=$(tmp_file fetched) |
454 | route=users/$1/gists _fetch_gists_with_pagnation $fetched_records | 454 | route=users/$1/gists _fetch_gists_with_pagnation $fetched_records |
455 | tac <$fetched_records | nl -s' ' \ | 455 | tac $fetched_records | nl -s' ' \ |
456 | | while read -r ${INDEX_FORMAT[@]}; do | 456 | | while read -r ${INDEX_FORMAT[@]}; do |
457 | echo $index $url $author $file_num $comment_num $description | cut -c -"$(tput cols)" | 457 | echo $index $url $author $file_num $comment_num $description | cut -c -"$(tput cols)" |
458 | done || { echo "Failed to query $1's gists"; exit 1; } | 458 | done || { echo "Failed to query $1's gists"; exit 1; } |