R
R
Roman Bolshukhin2021-10-24 21:07:02
bash
Roman Bolshukhin, 2021-10-24 21:07:02

How to loop sed?

Hello. There is such a script. How to make sed loop through a file multiple times? The script does not remove all replacements in 1 pass, only N times. Thanks

TRS=$(echo "$Downloads_file_film" |
sed 's/HDCLUB//' | 
sed 's/TDS//' | 
sed 's/tds//' |
sed 's/DTS//' |
sed 's/Dts//' |
sed 's/dts//' | 
sed 's/1080p//' | 
sed 's/1080P//' |
sed 's/1080i//' |
sed 's/1080I//' |
sed 's/720p//' | 
sed 's/720P//' | 
sed 's/BLURAY//' | 
sed 's/BluRay//' |
sed 's/Bluray//' |
sed 's/Blu-Ray//' |
sed 's/BDRip//' |
sed 's/BDRIP//' |
sed 's/BD.Rip//' |
sed 's/UNRATED//' |
sed 's/iTunes//' |
sed 's/Eng//' |
sed 's/ENG//' |
sed 's/Rus//' |
sed 's/RUS//' |
sed 's/Web-dl//' |
sed 's/WEB-DL//' |
sed 's/web-dl//' |
sed 's/Web.dl//' |
sed 's/WEB.DL//' |
sed 's/web.dl//' |
sed 's/WEBDL//' |
sed 's/GETTY//' |
sed 's/Getty//' |
sed 's/getty//' |
sed 's/AMZN//' |
sed 's/amzn//' |
sed 's/WEBRIP//' |
sed 's/WEBRip//' |
sed 's/webrip//' |
sed 's/NEWSTUDIO//' |
sed 's/newstudio//' |
sed 's/Newstudio//' |
sed 's/HD//' |
sed 's/Hd//' |
sed 's/HDR//' |
sed 's/Hdr//' |
sed 's/hdr//' |
sed 's/X264//' |
sed 's/x264//' |
sed 's/IMAX//' |
sed 's/EXKINORAY//' |
sed 's/ExKinoRay//' |
sed 's/DD2.0//' |
sed 's/dd2.0//' |
sed 's/DD5.1//' |
sed 's/dd5.1//' |
sed 's/MEGAPEER//' |
sed 's/MegaPeer//' |
sed 's/SELEZEN//' |
sed 's/seleZen//' |
sed 's/LOKALIZ-SOFCJ//' |
sed 's/KINOZAL//' |
sed 's/Kinozal//' |
sed 's/kinozal//' |
sed 's/TV//' |
sed 's/tv//' |
sed 's/HDTV//' |
sed 's/UKR//' |
sed 's/Ukr//' |
sed 's/ukr//' |
sed 's/H.264//' |
sed 's/h.264//' |
sed 's/H264//' |
sed 's/h264//' |
sed 's/ENIAHD//' |
sed 's/EniaHD//' |
sed 's/ENIA//' |
sed 's/Enia//' |
sed 's/MaNiAcS//' |
sed 's/UNIONGANG//' |
sed 's/Uniongang//' |
sed 's/ELEKTRI4KA//' |
sed 's/Elektri4ka//' |
sed 's/RUTRACKER.ORG//' |
sed 's/rutracker.org//' |
sed 's/HEVC//' |
sed 's/Hevc//' |
sed 's/hevc//' |
sed 's/STALKEROK//' |
sed 's/stalkerok//' |
sed 's/BLUEBIRD//' |
sed 's/Bluebird//' |
sed 's/AAC2.0//' |
sed 's/AaC2.0//' |
sed 's/aaC2.0//' |
sed 's/KION//' |
sed 's/Kion//' |
sed 's/kion//' |
sed 's/lq//' |
sed 's/(//' |
sed 's/)//' |
sed "s/А/A/" |
sed "s/а/a/" |
sed "s/Б/B/" |
sed "s/б/b/" |
sed "s/В/V/" |
sed "s/в/v/" |
sed "s/Г/G/" |
sed "s/г/g/" |
sed "s/Д/D/" |
sed "s/д/d/" |
sed "s/Е/E/" |
sed "s/е/e/" |
sed "s/Ё/YO/" |
sed "s/ё/yo/" |
sed "s/Ж/ZH/" |
sed "s/ж/zh/" |
sed "s/З/Z/" |
sed "s/з/z/" |
sed "s/И/I/" |
sed "s/и/i/" |
sed "s/Й/J/" |
sed "s/й/j/" |
sed "s/К/K/" |
sed "s/к/k/" |
sed "s/Л/L/" |
sed "s/л/l/" |
sed "s/М/M/" |
sed "s/м/m/" |
sed "s/Н/N/" |
sed "s/н/n/" |
sed "s/О/O/" |
sed "s/о/o/" |
sed "s/П/P/" |
sed "s/п/p/" |
sed "s/Р/R/" |
sed "s/р/r/" |
sed "s/С/S/" |
sed "s/с/s/" |
sed "s/Т/T/" |
sed "s/т/t/" |
sed "s/У/U/" |
sed "s/у/u/" |
sed "s/Ф/F/" |
sed "s/ф/f/" |
sed "s/Х/KH/" |
sed "s/х/kh/" |
sed "s/Ц/TS/" |
sed "s/ц/ts/" |
sed "s/Ч/CH/" |
sed "s/ч/ch/" |
sed "s/Ш/SH/" |
sed "s/ш/sh/" |
sed "s/Щ/SCH/" |
sed "s/щ/sch/" |
sed "s/Ъ/'/" |
sed "s/ъ/'/" |
sed "s/Ь/'/" |
sed "s/ь/'/" |
sed "s/Ы/Y/" |
sed "s/ы/y/" |
sed "s/Э/E/" |
sed "s/э/e/" |
sed "s/Ю/YU/" |
sed "s/ю/yu/" |
sed "s/Я/YA/" |
sed "s/я/ya/" |
tr -s '..' |
tr -s '__' | 
tr -s '._' |   
tr [:blank:] "." )
echo $TRS

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-10-24
@skyspirit

add the g modifier to the end of the regular expression, like this : ps in one:
sed 's/HDCLUB//g'
sed -e 's/xxx/ccc/g' -e 's/123/234/g'
sed 's/asd/qwe/g;s/123/234/g'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question