DescriptionAllow specifying environment variables w/ enter_chroot again.
Examples of how people might be using enter_chroot:
1. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 -- cmd arg1 arg2
Set env vars and run cmd w/ args
2. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2
Set env vars and run shell
3. ./enter_chroot [chroot_flags] -- cmd arg1 arg2
Run cmd w/ args
4. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 cmd arg1 arg2
Like #1 _if_ args aren't flags (if they are, enter_chroot will claim them)
5. ./enter_chroot [chroot_flags] cmd arg1 arg2
Like #3 _if_ args aren't flags (if they are, enter_chroot will claim them)
I also updated the help to indicate that whole-command quoting is no longer
supported. If you really need whole-command quoting (maybe you want in-
chroot redirection), you'll need to use sh -c like:
./enter_chroot.sh -- sh -c "echo \"Save me\" > /tmp/save.txt"
You should avoid single quotes in the command and arguments. This isn't
a new limitation: it's shflags related.
Change-Id: I0452a8730ac9b8197834edc753b9eece69896135
BUG=chromium-os:7072
TEST=Tried a whole bunch of these commands.
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=9362fa8
Patch Set 1 #
Total comments: 4
Patch Set 2 : Fixed desc for case #2 from previous submit. #Patch Set 3 : Use nicer syntax for test #Messages
Total messages: 6 (0 generated)
|