簡體   English   中英

具有sudo和System.cmd(“ mount”)的IEx塊

[英]IEx block with sudo and System.cmd(“mount”)

一些精度:

$> iex --version
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

IEx 1.4.4

$> mix --version
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Mix 1.4.4

我是法國人,我不明白為什么

$> iex -S mix

有一些錯誤:

$> sudo iex -S mix

我想在IEx中執行命令:

System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

用於測試和安裝ecryptfs分區。

$> iex -S mix
iex(2)> System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

{"mount: mount : seul le superutilisateur peut utiliser l'option « --options »\n",1}

我擁有正確的價值,無特權的坐騎

附:

$> sudo iex -S mix
iex(2)> System.cmd("mount", ["-t", "ecryptfs", ".private", "private", "-o", ~s(key=passphrase,passphrase_passwd="pass",ecryptfs_enable_filename_crypto=n,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n)], [stderr_to_stdout: true])

該命令會錯誤並打印任何內容。 它只是塊。 沒有返回錯誤代碼,什么也沒有,只是阻塞。 IEx不打印任何內容。

我有該錯誤的屏幕截圖:

在此處輸入圖片說明

好的,System.cmd不想在參數中引用。 好的。 :/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM