我使用Makefile来创建我正在处理的论文的pdf。我还想使用make将最新版本上传到我的网站,这需要sftp。我虽然可以做这样的事情(命令行上的哪些单词)但似乎在make中,EOF被忽略了,即这个
website:
sftp -oPort=2222 me@mywebsite.com << EOF
cd papers
put research_paper.pdf
EOF
生成错误消息
cd papers
/bin/sh: line 0: cd: papers: No such file or directory
我认为是&#34;论文&#34;在您的本地计算机上不存在,即&#39; cd&#39;正在本地执行,而不是远程执行。
答案 0 :(得分:2)
一些想法:
[Table("Ipv_Base")]
public class Ipv_Base
{
[Key]
public int ipv_baseId { get; set; }
public int companyId { get; set; }
[ForeignKey("companyId")]
public Company company { get; set; }
public string ipType { get; set; }
[Required]
public bool registedAddress { get; set; }
[Required]
[DataType(DataType.MultilineText)]
public string existingNotes { get; set; }
[Required]
public int numberOfAddresses { get; set; }
[Required]
public bool returnedAddressSpace { get; set; }
[DataType(DataType.MultilineText)]
public string additionalInformation { get; set; }
// navigation properties
public virtual IList<IpAllocation> requestedIps { get; set; }
}
[Table("Company")]
public class Company
{
[Key]
public int companyId { get; set; }
[Required]
public string name { get; set; }
[Required]
public string telephone { get; set; }
[Required]
public string regNumber { get; set; }
// navigation properties to keep track of the models that belong to the company
public virtual IList<Pa_Ipv4> pa_ipv4s { get; set; }
}
[Table("IpAllocation")]
public class IpAllocation
{
[Key]
public int ipAllocationId { get; set; }
public int ipv_BaseId { get; set; }
[ForeignKey("ipv_BaseId")]
public Ipv_Base ipv_Base { get; set; }
[Required]
public string allocationType { get; set; }
[Required]
public string subnet { get; set; }
[Required]
public string cidr { get; set; }
[Required]
public string mask { get; set; }
}
public class Pa_Ipv4 : Ipv_Base
{
public Pa_Ipv4()
{
ipType = "pa_ipv4";
}
}
变得不必要了cd
代替scp
对于它的价值,这是我的脚本将tarball推送到CRAN winbuilder - 并将目标目录和脚本作为sftp
的参数。
ncftpput
然后我做#!/bin/bash
function errorexit () {
echo "Error: $1"
exit 1
}
if [ "$#" -lt 1 ]; then
errorexit "Need to specify argument file"
fi
if [ ! -f ${1} ]; then
errorexit "File ${1} not found, aborting."
fi
ncftpput win-builder.r-project.org /R-release ${1}
ncftpput win-builder.r-project.org /R-devel ${1}
然后关闭......
答案 1 :(得分:1)
你不能(通常)在Make配方中的多行上放置一个命令,所以这里的文件是禁止的。试试这个:
website: research_paper.pdf
printf 'cd papers\nput $<\n' \
| sftp -oPort=2222 me@mywebsite.com
目标显然取决于PDF,所以我也明确依赖它。