Merge lp:~tyhicks/snappy-hub/snappy-examples-shell-command-line-args into lp:~snappy-dev/snappy-hub/snappy-examples

Proposed by Tyler Hicks
Status: Needs review
Proposed branch: lp:~tyhicks/snappy-hub/snappy-examples-shell-command-line-args
Merge into: lp:~snappy-dev/snappy-hub/snappy-examples
Diff against target: 24 lines (+8/-2)
1 file modified
hello-world/bin/sh (+8/-2)
To merge this branch: bzr merge lp:~tyhicks/snappy-hub/snappy-examples-shell-command-line-args
Reviewer Review Type Date Requested Status
Snappy Developers Pending
Review via email: mp+303868@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

100. By Tyler Hicks

hello-world/bin/sh: pass command line arguments to bash

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hello-world/bin/sh'
2--- hello-world/bin/sh 2016-03-11 18:28:29 +0000
3+++ hello-world/bin/sh 2016-08-24 21:19:54 +0000
4@@ -1,6 +1,11 @@
5 #!/bin/bash
6
7-cat <<EOM
8+shell="/bin/bash --norc"
9+
10+# Start an interactive shell if no command line arguments were given
11+if [ "$#" -eq 0 ]; then
12+ shell+=" -i"
13+ cat <<EOM
14 Launching a shell inside the default app confinement. Navigate to your
15 app-specific directories with:
16
17@@ -9,5 +14,6 @@
18 $ cd \$SNAP_USER_DATA
19
20 EOM
21+fi
22
23-/bin/bash --norc -i
24+$shell "$@"

Subscribers

People subscribed via source and target branches