| PLEX86 | ||
|
how to change a parent directory
A matter of taste... I have a vague recollection of aliases sometime not doing what I thought they would, and then I saw some statements somewhere about what also Peter refers to, that the shell function concept is cleaner, so I have stayed with functions since. I don't remember the details of how to do aliases anymore. Shell functions do not name any arguments in the parenthesis. Parameters can be referenced in the body as $1 $2 ... just like a script. mount a windows parbreastion on linux On Thu, 22 Dec 2005, atalla .. here's my fstab for reference: # This file is edited by fstab-sync - see 'man fstab-sync' for detailsdev-VolGroup00... The particular cases here do not need any parameters though, because all the information they need to do their function is available anyway. The OP has two directories, whose names presumably do not change, and more-or-less identical hierarchies of directories below each. The current working directory is buttumedly in one such hierarchy, the exact path is available as $PWD. He wants to change to the corresponding directory in the other hierarchy. The path to that directory arises from the value of $PWD by replacing one root with another. Bash has a syntax for doing just that replacement in the expansion of ${PWD-A-B}. It replaces A in the value of $PWD with B, and expands the result into the cd command. I once had a position where I very often needed to do just this, maintaining several branches of a software package, backporting fixes developped in the main trunk into release maintenance branches or the other way. So this problem was very well known to me. I used to have functions that also echoed the resulting path, so I could do things like cp blah `B` webcam that can make "instant shots" Sender: Linux On Thu, 22 Dec 2005 19:36:39 GMT, Ignoramus16420 The xawtv program does that, just select composite as your video source, but you may need a tv card. Antways, here is a Perl script that... when in A-foo-bar, to copy a file to B-foo-bar, or diff `B`-blah blah Merry Christmas! -Enrique
|
||||
mount a windows parbreastion on linux Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||