这是一个脚本,它从文件的replace.txt中读取单词并显示每行中每个单词的输出,但我想在一行中显示所有输出.
#!/bin/sh
echo
echo "Enter the word to be translated"
read a
IFS=" " # Set the field separator
set $a # Breaks the string into $1, $2, ...
for a # a for loop by default loop through $1, $2, ...
do
{
b= grep "$a" replaced.txt | cut -f 2 -d" "
}
done
"replacement.txt"文件的内容如下:
hllo HELLO m AM rshbh RISHABH jn JAIN hw HOW ws WAS ur YOUR dy DAY
这个问题不适合我的问题,我只需要帮助就可以将脚本的输出放在一行中.