Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
EADINGSmart
/
xcode_shell
Public
forked from
webfrogs/xcode_shell
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
xcode_shell
/
uploadItemsServicesFiles
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
60 lines (47 loc) · 1.47 KB
master
Breadcrumbs
xcode_shell
/
uploadItemsServicesFiles
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
60 lines (47 loc) · 1.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/expect -f
#--------------------------------------------
# 功能:先在服务器指定路径下新建文件夹,并将脚本所在路径下所有文件通过sftp协议上传到该文件夹中。
# 使用说明:命令有5个参数。注意:目前该脚本无参数验证功能,必须5个参数,否则脚本运行结果会发生错误
# 参数1:服务器中新建文件夹的名字;
# 参数2:服务器地址
# 参数3:sftp用户名
# 参数4:sftp密码
# 参数5:sftp工作路径
#
# 作者:ccf
# E-mail:ccf.developer@gmail.com
# 创建日期:2013/02/17
#--------------------------------------------
#参数设置
set filefolder [lindex $argv 0]
set host [lindex $argv 1]
set username [lindex $argv 2]
set password [lindex $argv 3]
set hostfilepath [lindex $argv 4]
#sftp连接
spawn sftp $username@$host
#第一次sftp时需输入yes
expect {
"(yes/no)?" {send "yes\r"; exp_continue}
"password:" {send "$password\r"}
}
#切换到所要放置的目录下
expect "sftp>"
send "cd $hostfilepath\r"
#判断文件夹是否已经存在,若不存在,则新建。之后进入到文件夹中
expect "sftp>"
send "ls $filefolder\r"
expect {
"No such file or directory" {send "mkdir $filefolder\r"; exp_continue}
"sftp>" {send "cd $filefolder\r"}
}
#删除文件夹中所有文件
expect "sftp>"
send "rm *\r"
#将当前路径下所有文件上传
expect "sftp>"
send "put ./*\r"
#退出sftp
expect "sftp>"
send "bye\r"
expect eof
You can’t perform that action at this time.