如何从文件中完全删除双引号和点

如何从文件中完全删除双引号和点

我有以下文件内容,我想从中删除双引号"和点.

Password expiration notice for beems Server
# cat pschagKK
Password expiration notice for "beems" Server.example.com
Password expiration notice for "beems" Server.example.com
Password expiration notice for "beems" Server.example.com
Password expiration notice for "goog_dev" Server.example.com
Password expiration notice for "goog_integ" Server.example.com
Password expiration notice for "noodle" Server.example.com
Password expiration notice for "noodle" Server.example.com
Password expiration notice for "pacct" Server.example.com
Password expiration notice for "pacct" Server.example.com
Password expiration notice for "pacct" Server.example.com
Password expiration notice for "pacct" Server.example.com
Password expiration notice for "pacct" Server.example.com

我正在尝试sed但无法找到一种方法来删除点:

# cat pschagKK | sed 's/"/ /g'
Password expiration notice for  beems  Server.example.com
Password expiration notice for  beems  Server.example.com

答案1

一种方法是sed

sed -e 's/[".]//g' <file

答案2

另一种方法(更少打字)是tr

tr -d '".' < file

相关内容