I have multiple files named as DOWN_1982_1.31.nc, DOWN_1982_2.31.nc .... DOWN_1982_12.31.nc. I want to rename them to DOWN_2040_1.31.nc, DOWN_2040_2.31.nc .... DOWN_2040_12.31.nc. How to do so using preferably an one liner bash script?
Home
/
user-987010
user962808's questions
I want to download some data using wget command from list of files, I used foll. code:
foreach file(`cat Model_list1.txt`)
echo $file
wget https://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/LISCOAST/10011/LATEST/EURO-CORDEX/EUR-11/SMHI-RCA4/"$file"/BC/historical/prAdjust_EUR-11_"$file"_historical_r1i1p1_SMHI-RCA4_v1-JRC-SBC-EOBS10-1981-2010_day_19810101-20101231.nc.gz
end
However, for every file name I am getting %0D at the end of the file name. I tried sed as follow to change the name of the file located in the file Model_list but still I am getting the same error. Kindly help me out. Thanks
sed 's/%0D//g' Model_list.txt > Model_list1.txt
where my Model_list.txt is
CNRM-CERFACS-CNRM-CM5
ICHEC-EC-EARTH
IPSL-IPSL-CM5A-MR
MOHC-HadGEM2-ES
MPI-M-MPI-ESM-LR