Simple loop

Revision as of 08:39, 12 April 2013 by Avagin (talk | contribs) (Created page with " $ cat > test.sh <<-EOF #!/bin/sh while :; do sleep 1 date done EOF $ chmod +x test.sh $ setsid ./test.sh < /dev/null &> test.log & [2] 2220 [2]+ Done ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
$ cat > test.sh <<-EOF
#!/bin/sh
while :; do
    sleep 1
    date
done
EOF

$ chmod +x test.sh
$ setsid ./test.sh  < /dev/null &> test.log &
[2] 2220
[2]+  Done                    setsid ./test.sh < /dev/null &>test.log
$  ps -C test.sh
 PID TTY          TIME CMD
2221 ?        00:00:00 test.sh
$  ~/crtools/crtools dump -t 2221 -vvv -o dump.log && echo OK
OK
$  ls
core-2221.img   eventpoll-tfd.img  filelocks-2221.img  inotify.img       netlinksk.img     pipes.img         sigacts-2424.img   test.log
core-2424.img   fanotify.img       filelocks-2424.img  inotify-wd.img    packetsk.img      pstree.img        signalfd.img       test.sh
creds-2221.img  fanotify-mark.img  fs-2221.img         inventory.img     pagemap-2221.img  reg-files.img     signal-p-2221.img  tty.img
creds-2424.img  fdinfo-2.img       fs-2424.img         itimers-2221.img  pagemap-2424.img  remap-fpath.img   signal-p-2424.img  tty-info.img
dump.log        fdinfo-3.img       ids-2221.img        itimers-2424.img  pages-1.img       rlimit-2221.img   signal-s-2221.img  unixsk.img
eventfd.img     fifo-data.img      ids-2424.img        mm-2221.img       pages-2.img       rlimit-2424.img   signal-s-2424.img  vmas-2221.img
eventpoll.img   fifo.img           inetsk.img          mm-2424.img       pipes-data.img    sigacts-2221.img  sk-queues.img      vmas-2424.img
$ ~/crtools/crtools restore -d -t 2221 -vvv -o restore.log && echo OK
OK