1 |
On 12/06/2016 16:33, Nico Verrijdt wrote: |
2 |
> Hi Andrew, |
3 |
> |
4 |
> 2016-06-12 16:26 GMT+02:00 Andrew Lowe <agl@×××××××.au |
5 |
> <mailto:agl@×××××××.au>>: |
6 |
> |
7 |
> Hi all, |
8 |
> A bit off topic here, but there are plenty of people who |
9 |
> seem to know their shells back to front so here goes. |
10 |
> |
11 |
> I have set up a Win32 based development environment, |
12 |
> bash/cc/ls/etc/etc, for 1st year Engineering students who have to |
13 |
> learn C on a command line. It's fine for me to remember to put the & |
14 |
> at the end of the command when I fire up the editor but for them, |
15 |
> it's major angst. |
16 |
> |
17 |
> The first thing that comes to mind is an alias. Just off |
18 |
> the top of my head I tried: |
19 |
> |
20 |
> alias "npp=npp %1 &" |
21 |
> |
22 |
> Shouldn't this be: alias npp="npp %1 &" ? |
23 |
> |
24 |
> |
25 |
> npp being the editor, but that didn't work. Is an alias the |
26 |
> best/easiest way to do this and if so, what would the syntax be, or |
27 |
> is there a better way? |
28 |
> |
29 |
> Any thoughts, greatly appreciated, |
30 |
> |
31 |
> Andrew |
32 |
> |
33 |
> |
34 |
> Hope this helps, |
35 |
> Nico |
36 |
|
37 |
|
38 |
Or just tell them to remember to add the & at the end. |
39 |
With an alias what will they do when they don't want it? |
40 |
|
41 |
Or look at it this way: |
42 |
|
43 |
It's syntax, it's important. C is probably more syntax-critical than any |
44 |
other language around (binds to the right, anyone?) so what's the |
45 |
problem with requiring correct syntax on the command line as well? |
46 |
|
47 |
Obligatory disclaimer: I've recently had a bellyache full of dumb people |
48 |
who insist I put code when a human (themselves) belongs... |