handy tip

For general rambling.
Post Reply
Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

handy tip

Post by Jonathan »

When writing shell scripts, consider whether you truly need to spawn a new shell when executing this command. Many shell scripts can be replaced by just the command or sequence of commands being called, especially for your own personal use. This can be important when, say, you have a wrapper to emacsclient that spawns a subshell that hangs around until the emacsclient returns.

Code: Select all

jdpearce  9468  0.0  0.0  2164  204 pts/59   S    Nov01   0:00 bash
jdpearce 19894  0.0  0.0  2164   44 pts/7    S    Sep22   0:00 bash
jdpearce 16947  0.0  0.0  2164   44 pts/7    S    Sep22   0:00 bash
jdpearce 26866  0.0  0.0  2164   44 pts/7    S    Sep20   0:00 bash
jdpearce 15231  0.0  0.0  2164   44 pts/7    S    Sep20   0:00 bash
jdpearce 15411  0.0  0.0  2164   44 pts/69   S    Sep16   0:00 bash
jdpearce 16953  0.0  0.0  2164   44 pts/59   S    Oct13   0:00 bash
jdpearce  7349  0.0  0.0  2164   44 pts/59   S    Oct11   0:00 bash
jdpearce 23219  0.0  0.0  2164   44 ?        S    Sep30   0:00 bash
jdpearce  6142  0.0  0.0  2164   44 ?        S    Sep30   0:00 bash
jdpearce  5881  0.0  0.0  2164   44 ?        S    Sep23   0:00 bash
jdpearce 28731  0.0  0.0  2164   44 ?        S    Sep19   0:00 bash
jdpearce 12585  0.0  0.0  2164   44 ?        S    Sep19   0:00 bash
jdpearce 23486  0.0  0.0  2164   44 ?        S    Oct07   0:00 bash
jdpearce  5017  0.0  0.0  2160  188 pts/59   S    Nov01   0:00 bash
jdpearce  1443  0.0  0.0  2160   44 pts/7    S    Sep28   0:00 bash
jdpearce 24852  0.0  0.0  2160   44 pts/7    S    Oct27   0:00 bash
jdpearce 28249  0.0  0.0  2160   44 pts/59   S    Oct18   0:00 bash
jdpearce 21477  0.0  0.0  2160   44 pts/59   S    Oct13   0:00 bash
jdpearce 17813  0.0  0.0  2160   44 pts/59   S    Oct13   0:00 bash
jdpearce 17566  0.0  0.0  2160   44 pts/59   S    Oct10   0:00 bash
jdpearce 20440  0.0  0.0  2160   44 ?        S    Sep30   0:00 bash
jdpearce 23145  0.0  0.0  2160   44 ?        S    Sep20   0:00 bash
jdpearce 24037  0.0  0.0  2160   44 ?        S    Sep19   0:00 bash
jdpearce 16776  0.0  0.0  2156   92 pts/7    S    Nov01   0:00 bash
jdpearce 16266  0.0  0.0  2156   44 pts/71   S    Oct03   0:00 bash
jdpearce 13646  0.0  0.0  2156   44 pts/7    S    Sep30   0:00 bash
jdpearce 20493  0.0  0.0  2156   44 pts/7    S    Sep21   0:00 bash
jdpearce 11598  0.0  0.0  2156   44 pts/7    S    Oct10   0:00 bash
jdpearce 21127  0.0  0.0  2156   44 pts/59   S    Oct25   0:00 bash
jdpearce 20866  0.0  0.0  2156   44 pts/59   S    Oct25   0:00 bash
jdpearce 23241  0.0  0.0  2156   44 ?        S    Sep30   0:00 bash
jdpearce 22978  0.0  0.0  2156   44 ?        S    Sep20   0:00 bash
jdpearce 24835  0.0  0.0  2156   44 ?        S    Sep19   0:00 bash
jdpearce 23307  0.0  0.0  2156   44 ?        S    Sep19   0:00 bash
jdpearce 26886  0.0  0.0  2156   44 ?        S    Oct06   0:00 bash
jdpearce   375  0.0  0.0  2076   44 ?        S    Sep16   0:00 xstartup
jdpearce  3575  0.0  0.0  2056  956 pts/111  S    13:59   0:00 sh
jdpearce 12583  0.0  0.0  1784  240 ?        S    Sep19   0:00 emacsserver
jdpearce 26252  0.0  0.0  1656   48 ?        S    Sep30   0:00 rsh
jdpearce  4031  0.0  0.0  1508  472 pts/111  S    14:05   0:00 egrep
jdpearce   488  0.0  0.0  1488   48 ?        S    Sep16   0:00 gnome-pty-helpe
jdpearce 28250  0.0  0.0  1484   36 pts/59   S    Oct18   0:00 emacsclient
jdpearce 17567  0.0  0.0  1484   36 pts/59   S    Oct10   0:00 emacsclient
jdpearce 12586  0.0  0.0  1484   36 ?        S    Sep19   0:00 emacsclient
jdpearce 20494  0.0  0.0  1480   36 pts/7    S    Sep21   0:00 emacsclient
jdpearce 15232  0.0  0.0  1480   36 pts/7    S    Sep20   0:00 emacsclient
jdpearce 24836  0.0  0.0  1480   36 ?        S    Sep19   0:00 emacsclient
jdpearce  9471  0.0  0.0  1432  100 pts/59   S    Nov01   0:00 emacsclient
jdpearce 16954  0.0  0.0  1432   36 pts/59   S    Oct13   0:00 emacsclient
jdpearce  6143  0.0  0.0  1432   36 ?        S    Sep30   0:00 emacsclient
jdpearce  5882  0.0  0.0  1432   36 ?        S    Sep23   0:00 emacsclient
jdpearce 28732  0.0  0.0  1432   36 ?        S    Sep19   0:00 emacsclient
jdpearce 23487  0.0  0.0  1432   36 ?        S    Oct07   0:00 emacsclient
jdpearce  3576  0.0  0.0  1428  432 pts/111  S    13:59   0:00 emacsclient
jdpearce  5018  0.0  0.0  1428   96 pts/59   S    Nov01   0:00 emacsclient
jdpearce  1444  0.0  0.0  1428   36 pts/7    S    Sep28   0:00 emacsclient
jdpearce 19895  0.0  0.0  1428   36 pts/7    S    Sep22   0:00 emacsclient
jdpearce 16950  0.0  0.0  1428   36 pts/7    S    Sep22   0:00 emacsclient
jdpearce 26867  0.0  0.0  1428   36 pts/7    S    Sep20   0:00 emacsclient
jdpearce 21478  0.0  0.0  1428   36 pts/59   S    Oct13   0:00 emacsclient
jdpearce  7350  0.0  0.0  1428   36 pts/59   S    Oct11   0:00 emacsclient
jdpearce 23220  0.0  0.0  1428   36 ?        S    Sep30   0:00 emacsclient
jdpearce 20441  0.0  0.0  1428   36 ?        S    Sep30   0:00 emacsclient
jdpearce 23146  0.0  0.0  1428   36 ?        S    Sep20   0:00 emacsclient
jdpearce 24038  0.0  0.0  1428   36 ?        S    Sep19   0:00 emacsclient
jdpearce 16267  0.0  0.0  1424   36 pts/71   S    Oct03   0:00 emacsclient
jdpearce 13647  0.0  0.0  1424   36 pts/7    S    Sep30   0:00 emacsclient
jdpearce 24853  0.0  0.0  1424   36 pts/7    S    Oct27   0:00 emacsclient
jdpearce 11599  0.0  0.0  1424   36 pts/7    S    Oct10   0:00 emacsclient
jdpearce 16777  0.0  0.0  1424   36 pts/7    S    Nov01   0:00 emacsclient
jdpearce 21130  0.0  0.0  1424   36 pts/59   S    Oct25   0:00 emacsclient
jdpearce 20867  0.0  0.0  1424   36 pts/59   S    Oct25   0:00 emacsclient
jdpearce 17814  0.0  0.0  1424   36 pts/59   S    Oct13   0:00 emacsclient
jdpearce 23242  0.0  0.0  1424   36 ?        S    Sep30   0:00 emacsclient
jdpearce 22979  0.0  0.0  1424   36 ?        S    Sep20   0:00 emacsclient
jdpearce 23308  0.0  0.0  1424   36 ?        S    Sep19   0:00 emacsclient
jdpearce 26889  0.0  0.0  1424   36 ?        S    Oct06   0:00 emacsclient



Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Or, heh, I could use the --no-wait option on emacsclient, which appears to make it just the same as visiting the file in emacs directly (i.e. you use the memory for the buffer and no more). Whoops.

Post Reply