我非常绝望。我有需要在终端bash中预处理的数据。然后我需要使用特殊格式保存我的数据 - 如字体,字母大小等=创建REPORT以便在Libreoffice或Word中可读。
这是我的剧本
#!/bin/bash
BOLD='\033[1m'
format2="%10s"
printf "\n \n"
echo -e "${BOLD}THIS I WANT TO KEEP BOLD IN DOCUMENT:${NONE}"
awk 'BEGIN{print "COL1","COL2","COL3","COL4","COL5"}' | column -t | sed 2i$(printf "=%.0s" {1..50})
printf "=%.0s" {1..50}
printf "\n \n"
#printf "=%.0s" {1..45}
#printf "\n"
printf "$format2" "DESCRIBE CLASS:"
printf "\n \n"
printf "$format2" "1. CLASS"
printf "\n"
printf "$format2" "2. CLASS"
printf "\n"
printf "$format2" "3. CLASS"
printf "\n"
printf "$format2" "4. CLASS"
printf "\n \n"
当我运行./script.sh > foo.doc
当我在Libre xdg-open foo.doc
打开我的文档时,我没有粗体文字。我还需要特定的字体(verdana)和字体大小。
我真的不知道如何在bash中格式化文本以直接在Libre / Word中打开..
有可能吗?