我在.txt文件中有一个单词列表
About
Who
Get
Which
Go
Me
When
Make
我需要获得
user:About
user:Who
user:Get
user:Which
user:Go
user:Me
user:When
user:Make
你能告诉我我可以用什么来获得这个?列表太长,无法手动放置。 谢谢!
答案 0 :(得分:1)
你走了:
sh script.sh list
#!/bin/bash
while read line
do
#VARIABLES
file=$line
echo "user:"$file >> output
done < $1
希望它有所帮助。 湾
答案 1 :(得分:1)
perl -pi -e 's/^/user:/' a.txt