Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: perseous
1,986
Posted By perseous
worked finally! thank you!
worked finally! thank you!
1,986
Posted By perseous
got: + read LINE + sed $'s/XXXX/home\r/'...
got:

+ read LINE
+ sed $'s/XXXX/home\r/' file1.txt
+ read LINE
+ sed $'s/XXXX/school\r/' file1.txt
+ read LINE
+ sed $'s/XXXX/cinema\r/' file1.txt
+ read LINE


file3.txt:

Monday home...
1,986
Posted By perseous
#!/bin/bash set -x while read LINE do ...
#!/bin/bash
set -x
while read LINE
do
sed 's/XXXX/'$LINE'/' file1.txt >>file3.txt
done<file2.txt
cat file3.txt


here is exact file3.txt:

Monday home

Tuesday home

home
...
1,986
Posted By perseous
content is fine. Think it's just not work for me....
content is fine. Think it's just not work for me. Could u explain why i get this on first solution? SOrry if i bother you because i really need this whereas i'm noob myself


#!/bin/bash

set...
1,986
Posted By perseous
Here's what i get when tried rajamadhavan's post:...
Here's what i get when tried rajamadhavan's post:

Monday home
Tuesday home
Wednesday
Monday school
Tuesday school
Wednesday
Monday cinemaol
Tuesday cinema
cinema Wednesday
Thursday...
1,986
Posted By perseous
# sed 's/XXXX/'$LINE'/' file1.txt>>file3.txt +...
# sed 's/XXXX/'$LINE'/' file1.txt>>file3.txt
+ sed s/XXXX// file1.txt
# set -x done file2.txt
+ set -x done file2.txt
# cat file3.txt
+ cat file3.txt
Monday
Tuesday...
1,986
Posted By perseous
sorry, i don't know well : sed...
sorry, i don't know well :
sed 's/XXXX/'$LINE'/' file1.txt >>file3.txt
set -x done file2.txt
cat file3.txt

and i get file3:

Monday
Tuesday
Wednesday
Thursday


Do i miss sth?
1,986
Posted By perseous
thanks for quickly help.but i got : -bash:...
thanks for quickly help.but i got :
-bash: syntax error near unexpected token `done'
1,986
Posted By perseous
Replace a string with each line from another file repeatedly
I don't know if it's been asked before but seems i gave up seeking.

i have 2 files :
file1.txt

Monday XXXX
Tuesday XXXX
XXXX Wednesday
Thursday XXXX
XXXX is in every lines of file1.txt and...
Showing results 1 to 9 of 9

 

Featured Tech Videos

All times are GMT -4. The time now is 12:22 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy