debug_libgen_getname_command.sh:
#!/bin/bash
#needs to add quotes, or the '&res=100' parameter was not passed correctly
#"http://gen.lib.rus.ec/search.php?req=cohen+tannoudji+atom+and+photon&lg_topic=libgen&open=0&view=simple&res=100&phrase=0&column=def"
#wget -O $1 "http://gen.lib.rus.ec/search.php?req=cohen+tannoudji+atom+and+photon&lg_topic=libgen&open=0&view=simple&res=100&phrase=0&column=def"
wget -O $1 "http://gen.lib.rus.ec/search.php?req=A.P.+French+special+relativity&lg_topic=libgen&open=0&view=simple&res=100&phrase=0&column=def"
INPUT_FILE=$1
grep -n -e "<a href=.*id=[0-9]*>.*" "${INPUT_FILE}" | sed 's/\(.*\)id=[0-9]*>\(.[^<]*\)<.*/\2/g' | sed 's/^\(.*\)[\ ][\ ]*$/\1/g'
多半我以后再也不用这个sh来给文件改名了。