Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 使用find和curl将目录内容上载到Sonatype Nexus存储库_Bash_Curl_Nexus - Fatal编程技术网

Bash 使用find和curl将目录内容上载到Sonatype Nexus存储库

Bash 使用find和curl将目录内容上载到Sonatype Nexus存储库,bash,curl,nexus,Bash,Curl,Nexus,我试图使用curl通过bash将目录的内容上传到nexus,但我使用的命令中有一些问题 简而言之,我想在一个特定的目录上执行find命令,并使用–exec{}操作执行curl to nexus 但是,我的find命令返回包括源目录在内的文件路径,我希望对此进行更改,以便只显示内容,而不是完整路径 e、 假设我有一个名为trunk的目录,其中包含这些文件和子目录 trunk/directory1/file1 trunk/directory2/file1 trunk/directory2/file2

我试图使用curl通过bash将目录的内容上传到nexus,但我使用的命令中有一些问题

简而言之,我想在一个特定的目录上执行find命令,并使用–exec{}操作执行curl to nexus

但是,我的find命令返回包括源目录在内的文件路径,我希望对此进行更改,以便只显示内容,而不是完整路径

e、 假设我有一个名为trunk的目录,其中包含这些文件和子目录

trunk/directory1/file1
trunk/directory2/file1
trunk/directory2/file2
我希望find命令返回

directory1/file1
directory2/file1
directory2/file2
然后可以将其传递给我的exec命令

我当前的find命令是:-

find trunk -type f -exec curl --user user:pass --ftp-create-dirs -T {} https://PATH_TO_NEXUS/{} \;
除了在nexus中创建的文件是

https://PATH_TO_NEXUS/trunk/directory1/file1
我想要的是

https://PATH_TO_NEXUS/directory1/file1

有人有什么想法吗?

主干
目录中运行
查找
命令:

cd trunk
find . -type f -exec curl --user user:pass --ftp-create-dirs -T {} https://PATH_TO_NEXUS/{} \;

我怎么会错过呢?我陷入了一种模式,完全忘记了基本的东西。谢谢你