Thread Ein Skript, das auf <STDIN> wartet mit einem anderen Skript aufrufen?
(15 answers)
Opened by Sven_123 at 2010-06-22 16:44 2010-06-22T14:58:34 murphy der erste satz stimmt so nicht. mit exec startet man ein programm aus einem prozess heraus, ohne einen neuen prozess zu generieren. exec [-cl] [-a name] [command [arguments]] If command is specified, it replaces the shell. No new process is created. z.B (sorry, ausgabe etwas verschoben. die blanks werden anscheinend getrimmt): Ausgangsbasis: neue login shell aufmachen [root@hopfen ~]# bash -l [root@hopfen ~]# ps auxf root 3148 0.0 0.0 7088 1064 ? Ss Jun02 0:15 /usr/sbin/sshd root 16200 0.0 0.0 10072 2952 ? Ss 07:09 0:00 \_ sshd: root@pts/1 root 16202 0.0 0.0 4672 1512 pts/1 Ss 07:09 0:00 | \_ -bash root 26517 0.0 0.0 4368 948 pts/1 R+ 08:25 0:00 | \_ ps auxf root 24381 0.0 0.0 10072 2920 ? Ss 08:21 0:00 \_ sshd: root@pts/0 root 24383 0.0 0.0 4672 1520 pts/0 Ss 08:21 0:00 \_ -bash root 26499 0.5 0.0 4672 1456 pts/0 S+ 08:25 0:00 \_ bash -l 1. mit fork [root@hopfen ~]# vi [root@hopfen ~]# ps auxf root 3148 0.0 0.0 7088 1064 ? Ss Jun02 0:15 /usr/sbin/sshd root 16200 0.0 0.0 10072 2952 ? Ss 07:09 0:00 \_ sshd: root@pts/1 root 16202 0.0 0.0 4672 1512 pts/1 Ss 07:09 0:00 | \_ -bash root 26867 0.0 0.0 4368 956 pts/1 R+ 08:26 0:00 | \_ ps auxf root 24381 0.0 0.0 10072 2920 ? Ss 08:21 0:00 \_ sshd: root@pts/0 root 24383 0.0 0.0 4672 1520 pts/0 Ss 08:21 0:00 \_ -bash root 26499 0.0 0.0 4672 1464 pts/0 S 08:25 0:00 \_ bash -l root 26599 0.1 0.0 9600 2780 pts/0 S+ 08:25 0:00 \_ /usr/bin/vim nach :q in vi [root@hopfen ~]# ps auxf root 3148 0.0 0.0 7088 1064 ? Ss Jun02 0:15 /usr/sbin/sshd root 16200 0.0 0.0 10072 2952 ? Ss 07:09 0:00 \_ sshd: root@pts/1 root 16202 0.0 0.0 4672 1512 pts/1 Ss 07:09 0:00 | \_ -bash root 27694 0.0 0.0 4368 972 pts/1 R+ 08:27 0:00 | \_ ps auxf root 24381 0.0 0.0 10072 2920 ? Ss 08:21 0:00 \_ sshd: root@pts/0 root 24383 0.0 0.0 4672 1520 pts/0 Ss 08:21 0:00 \_ -bash root 26499 0.0 0.0 4672 1464 pts/0 S+ 08:25 0:00 \_ bash -l 2. mit exec [root@hopfen ~]# exec vi [root@hopfen ~]# ps auxf root 3148 0.0 0.0 7088 1064 ? Ss Jun02 0:15 /usr/sbin/sshd root 16200 0.0 0.0 10072 2952 ? Ss 07:09 0:00 \_ sshd: root@pts/1 root 16202 0.0 0.0 4672 1512 pts/1 Ss 07:09 0:00 | \_ -bash root 28258 0.0 0.0 4368 948 pts/1 R+ 08:28 0:00 | \_ ps auxf root 24381 0.0 0.0 10072 2920 ? Ss 08:21 0:00 \_ sshd: root@pts/0 root 24383 0.0 0.0 4672 1520 pts/0 Ss 08:21 0:00 \_ -bash root 26499 0.0 0.0 4788 1220 pts/0 S+ 08:25 0:00 \_ vi nach :q in vi [root@hopfen ~]# ps auxf root 3148 0.0 0.0 7088 1064 ? Ss Jun02 0:15 /usr/sbin/sshd root 16200 0.0 0.0 10072 2952 ? Ss 07:09 0:00 \_ sshd: root@pts/1 root 16202 0.0 0.0 4672 1512 pts/1 Ss 07:09 0:00 | \_ -bash root 28652 0.0 0.0 4368 972 pts/1 R+ 08:29 0:00 | \_ ps auxf root 24381 0.0 0.0 10072 2920 ? Ss 08:21 0:00 \_ sshd: root@pts/0 root 24383 0.0 0.0 4672 1520 pts/0 Ss+ 08:21 0:00 \_ -bash mod-edit pq: teilbaum "forken" Last edited: 2010-06-23 16:26:37 +0200 (CEST) root is a state of mind - k0resh
|