X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=febootstrap-run.pod;h=9072f5a4d9f0a6213261679e0b9bf295aeb9fb9e;hb=467d77a9af3dbb1a4bcfbb9c7f97c8e300d6dca0;hp=c5e713c045530e64613151cc1b32932e5c920567;hpb=9cf3beefb865ea3e1a4bbe570d632649540788cc;p=febootstrap.git diff --git a/febootstrap-run.pod b/febootstrap-run.pod index c5e713c..9072f5a 100644 --- a/febootstrap-run.pod +++ b/febootstrap-run.pod @@ -37,6 +37,35 @@ contents still happen). =back +=head1 EXAMPLES + +One way to create a new file with specific ownership and permissions +from a script is to create new content for a file as C: + + #!/bin/bash + + echo blah > root/file.new + +then "install" it with the correct ownership and permissions. + + febootstrap-run root -- install -m 0644 -o root -g root /file.new /file + rm root/file.new + +(This requires that the C command from coreutils +exists inside the root.) + +Another way to do complex operations from a script is to export a +function: + + #!/bin/bash + + do_stuff () + { + # complex operations inside the root + } + export -f do_stuff + febootstrap-run root -- bash -c do_stuff + =head1 ENVIRONMENT VARIABLES Some L environment variables are applicable. In