我正在嘗試使用wget
下載的列表中的單行添加URL。將URL添加到特定文件中的行
下面Bash腳本的第一部分下載列表,URL是靜態的。 sed命令是嘗試將URL添加到列表中。
的bash
#!/bin/bash
wget -q --user=xxxx --password=xxxxx --xxxx \
xxx://www.xxx.com/xxxx/xxx/xxxx/list
url=xxx://www.xxx.com/xxxx/xxx/xxxx/
sed s/$url/ list.txt | url_list.txt
sed: -e expression #1, char 14: unknown option to `s'
當前列表
FilterDuplicates.html
file1.bam
file2.bam
file1.vcf.gz
file2.vcf.gz
所需列表(與$url
文件名之前)
xxx://www.xxx.com/xxxx/xxx/xxxx/FilterDuplicates.html
xxx://www.xxx.com/xxxx/xxx/xxxx/file1.bam
xxx://www.xxx.com/xxxx/xxx/xxxx/file2.bam
xxx://www.xxx.com/xxxx/xxx/xxxx/file1.vcf.gz
xxx://www.xxx.com/xxxx/xxx/xxxx/file2.vcf.gz
編輯
#!/bin/bash
wget -q --user=xxxx --password=xxxx --xxxx \
https://www.xxxx.com/xxx/xx/xxxx/file
$url="https://www.xxxx.com/xxx/xx/xxxx/";
sed "s|^|$url|" /home/cmccabe/list > /home/cmccabe/url_list.txt
https://www.xxxx.com/xxx/xx/xxxx/: no such file or directory
這是sed
是接近,但其附加的URL文件的末尾,而不是象所希望的輸出的每一行。謝謝:)
sed -i '$a https://www.xxxx.com/xxx/xx/xxxx/' /home/cmccabe/list
輸出
FilterDuplicates.html
file1.bam
file2.bam
file1.vcf.gz
file2.vcf.gz
https://www.xxxx.com/xxx/xx/xxxx/
sed命令來添加文本
sed 's/^/https://www.xxxx.com/xxx/xx/xxxx//' /home/cmccabe/list
pluse-uno用於示例數據,輸出和代碼! – shellter