わたしにはできる。私はJavaでテストしていませんが、次のようにテストしましたsleep
:
victor@vz:~$ exec -a minecraft sleep 1m &
[1] 3858
victor@vz:~$ ps x | grep mine
3858 pts/2 S 0:00 minecraft 1m
3860 pts/2 S+ 0:00 grep --color=auto mine
victor@vz:~$
ただし、ドキュメントからわかる限り、これは単なる表面的な変更のようです。
victor@vz:~$ help exec exec: exec [-cl] [-a name] [command [arguments ...]] [redirection ...] シェルを指定されたコマンドに置き換えます。
Execute COMMAND, replacing this shell with the specified program.
ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
any redirections take effect in the current shell.
Options:
-a name pass NAME as the zeroth argument to COMMAND
この回答に対するOPのコメントを参照して、Javaを使用してリモートマシンでもテストしました:
victorz@exa:~$ javac test.java # spits out an Administrator.class file among others
victorz@exa:~$ exec -a minecraft java Administrator &
[1] 13142
victorz@exa:~$ ps x | grep mine
13142 pts/1 Sl 0:00 minecraft Administrator
13161 pts/1 S+ 0:00 grep --color=auto mine
victorz@exa:~$
多分あなたはへのx
スイッチを使用していませんps
か?x
スイッチを使わないとマッチしません。