Skip to main content

Thread: Does ubuntu copy scripts to memory?


i'm making script if script fails, make separate script call original script input parameters again..

ie, type in /path/script.sh $1 $2 $3, , fails, output parameters file contains commands have failed since last time script-created-script run.

possible this?

file: /path/thisfile.sh
code:
  rm /path/thisfile.sh /path/script.sh $1 $2 $3   /path/script.sh $1 $2 $3 /path/script.sh $1 $2 $3
or rm /path/thisfile.sh delete thisfile.sh before executed?

have tried it?
don't know script gets stored in memory , how run, following seems suggest it's safe remove script while running:
code:
$ cat /tmp/tmp.sh  #! /bin/bash  echo hello1 $1 $2 $3  rm /tmp/tmp.sh  echo hello2 $1 $2 $3  $ /tmp/tmp.sh b c  hello1 b c  hello2 b c  $ ls /tmp/tmp.sh  ls: cannot access /tmp/tmp.sh: no such file or directory
i'm making script if script fails, make separate script call original script input parameters again..

ie, type in /path/script.sh $1 $2 $3, , fails, output parameters file contains commands have failed since last time script-created-script run.

possible this?
i'm not sure understood trying do.
give more precise example? or explain problem trying solve?

mean this?:

script1.sh
code:
good cmd #runs  cmd #runs  bad cmd #runs , fails. script1.sh writes script2.sh , exits  cmd #does not run
script2.sh
code:
bad cmd


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [ubuntu] Does ubuntu copy scripts to memory?


Ubuntu

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'