Prev: wget, forms, password, cookies
Next: Call for Paper The International Journal of Computer Science (IJCS)
From: Glenn Jackman on 2 Mar 2010 13:07 At 2010-03-02 12:06PM, "Seebs" wrote: > On 2010-03-02, PGK <graham.keir(a)gmail.com> wrote: > > function doit { > > cd $1/src > > make > > cd - > > } > > Note that you don't need the "cd -", because each command is run in its own > environment, so there's no need to move it back to another directory. Yes, you do. Functions defined inside {braces} execute in the same environment. If you use (parentheses), then you get a subshell. test_cd1() { cd /tmp; } # stays in /tmp after execution test_cd2() ( cd /tmp; ) # returns to previous cwd -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous
From: Kaz Kylheku on 4 Mar 2010 08:17 On 2010-03-02, PGK <graham.keir(a)gmail.com> wrote: > Hi everyone, > > I'm trying to write a bash script which will cd into each directory in > the current one; Did you look among the examples in your /usr/share/doc/bash or whereever? :)
First
|
Prev
|
Pages: 1 2 3 Prev: wget, forms, password, cookies Next: Call for Paper The International Journal of Computer Science (IJCS) |