> Ok, a few questions for y'all:
> 1. I want to be able to make an alias that will just output the
> subdirectories of a variable directory. Similar to DOS's "dir /ad" but
> I want to input the directory (command line option, $1). I know the
> find command works: " find <path> -type d -maxdepth 1 ". Why doesn't
> "find /$1 ..... work for the same argument if the executable is names
> 'ld ' ---> " ld usr " where <path> before was /usr?
I' completely confused by this one! Maybe you should try `ls
/the/path/to/*/something or similar' (Those jokers are just great!)
Quote:> 2. I want to remove an element from my PATH environmental variable.
> What file is it stored in?
bash, sh & co: /etc/profile; csh: /etc/csh.cshrc -- but that's the global
default. To remove it from your path only, you'd have to do something like:
export PATH=`echo $PATH | sed -e s~:path/you/want/removed:~:~g`
Note: The directory has to be between other directories in the $PATH,
otherwise the expression won't match.
export PATH=`echo $PATH | sed -e s~:PYWR:~:~; s~^PYWR:~~; s~:PYWR$~~`
should fix this.
Quote:> 3. Do I have this right. Grep is only good if you specify ONE directory
> to search for strings in a file or files? How do I search for strings
> across multiple directories?
find <path> -type f -exec grep -l <string> {} \; -exec grep <string> {} \;
This isn't at all a good sollution: You can hardly see the filenames
(written by the first grep), grep is run twice for every file in the
tree and the searchstring has to be entered twice.
for i in `find <path> -type d` ; do grep -i <string> $i/* ; done
might be better, but it will produce a lot of error messages (`No such file
or directory' and `Is a directory')
for i in `find <path> -type d` ; do for j in $i/* ; do test -f $j && grep -i
<string> $j ; done ; done
(all in one line) fixes the error messages (a simple 2>/dev/null would have
worked also) but then you don't have filenames.
Quote:> 4. My book specifies that umount applies to the device and not the mount
> point. Well my system works just the opposite. That is, I type: "
> umount /mnt/dos " where dos is a mount point.
It should work both ways, i.e. whether you give umount the special file or
the mount point should not matter.
HIH,
Peter
--
---------------------------------------------------------------------
Throughout this HOWTO, a manual entry is simply referred to as a
man page, regardless of actual length and without sexist intention.
[The Linux Man-Page-Howto]