This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
spath=$(realpath "$0") | |
swd=${spath%/*} | |
source "$swd"/lns.bashlib | |
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source ./testf.bashlib | |
test1(){ | |
echo "hello world" | |
} | |
test_init_dir_unexist(){ | |
[ -e ./test9 ] && rm -r ./test9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
import_note_by_fpath_data(){ | |
import_note_tag_by_fpath_data(){ | |
get_note_taglist_by_fpath_data(){ | |
line_tag=$(grep -m 1 '^tag::' "$fpath_data") | |
taglist="$(echo ${line_tag##*:})" | |
} | |
fpath_data="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
get_line_tag(){ | |
tagval="$1" | |
fpath="$2" | |
# unable to check $? for this gawk | |
line_tag=$(gawk -v ptn="$tagval([[:space:]]|$)" '$0~ptn && NR >= 3 && NR <= 5 {print NR":"$0;exit;}' "$fpath") | |
#echo "line_tag: $line_tag" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tagval="$1" | |
fpath="$2" | |
# unable to check $? for this gawk | |
line_tag=$(gawk -v ptn="$tagval([[:space:]]|$)" '$0~ptn && NR >= 3 && NR <= 5 {print NR":"$0;exit;}' "$fpath") | |
echo "line_tag: $line_tag" | |
fpath_taglist=./tag_list.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Once the global warmth reaches a tipping point, | |
# the chain-reaction could be irreversible, | |
# so are we ready for the ticking bomb? | |
# Usage: | |
# ./bash2sh.bash ./test/b.bash c.bash [...] | |
# ./bash2sh.bash " " ./test/a ./test/{b,c}.bash ./test/dir/{.,d.bash} | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# move files to dir_destination | |
# ./mv_files2dir.bash /path/to/file dir_destination | |
# ./mv_files2dir.bash dir_a ./{b,c} dir_destination | |
# test_mv_files2dir.bash: | |
# #!/bin/bash | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The bubbles in the asset markets | |
# are equivalent to various taxes, | |
# payed by each of us in the long term, | |
# whether a winner or loser in the game. | |
# Features: | |
# Change a pair of link files | |
# from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Features: | |
# Renaming file or files by batch with the shell script. | |
# Rename by multiple pairs of file names. | |
# Use the `mv` command along with `grep` etc. underlyingly. | |
# A rather simplified alternative to the `rename` shipped by some linux systems. | |
# Usage: | |
# 1. Rename a file by one pair of file names: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Tag line editing | |
# Change the line | |
# from | |
# vocabulary grammar | |
# to | |
# tag:: vocabulary grammar | |
# Change by a given tag value such as "vocabulary" or "grammar" | |
# Omit the tag line if they already have the key word of "tag" |
NewerOlder