echo Would you like to upgrade to osu!lazer version number: $x3
read -r -p "Type [Y/N] to confirm decision: " response
case "$response" in [yY][eE][sS]|[yY])\
clear
rm -f ~/Documents/lazerversion.txt
echo $x3 >> ~/Documents/lazerversion.txt
echo osu!lazer Updater
echo -----------------
echo Updating.
x4=$(sed -n '/browser_download_url/p' ~/Documents/releasefull.txt | head -2)
echo $x4 >> ~/Documents/tempresult.txt
fold -s -w80 ~/Documents/tempresult.txt
;;
*)
clear
echo osu!lazer Updater
echo -----------------
echo Goodbye.
;;
esac
问题是fold -s -w80 ~/Documents/tempresult.txt
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
我得到上面的文字。
我想得到这个:
"browser_download_url":
"https://github.com/ppy/osu/releases/download/2018.915.0/install.exe"
"browser_download_url":
"https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
上面的文字各有不同。
我使用fold -s -w80 ~/Documents/tempresult.txt
的方式有什么问题
我希望将原始文本拆分为单独的行;
"browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/install.exe" "browser_download_url": "https://github.com/ppy/osu/releases/download/2018.915.0/osu.app.zip"
提前谢谢,节奏
你可以尝试一下。
awk '{$1=$1}1' OFS="\n" Input_file
要么
your_fold_command | awk '{$1=$1}1' OFS="\n"