Re: Possibly Off Topic Rant

2009-03-02 Thread Bob Proulx
Ray Parrish wrote:
 And as another note, even 'though I've used the -d switch to show only
 directories in the output I'm still getting filenames with it.

Please see the Coreutils FAQ on 'ls -d'.

  
http://www.gnu.org/software/coreutils/faq/#ls-_002dd-does-not-list-directories_0021

 I had to further read the info pages, ...

But the info doc is the main documentation.  You should start there
and not put it off until later.

 I remember programming in DOS batch language, and I never had this much
 trouble understanding the syntax because it was right there in the docs.

The DOS batch language is much simpler and is therefore easier to
understand.  But it is also much less powerful.  In my experience it
is much harder to use than Unix shells for more than very simple
things due to its limitations.  Easy things are easy but hard things
are very hard.

The Unix shell was created following the Unix philosophy which is to
design and build applications in modular layers.  This layered design
philosophy is much more flexible at the expense that the writer will
need to understand multiple layers in order to operate the system.
But if each layer is relatively small and simple by itself then
building them together into a more complex whole is easier than trying
to create a complete solution all at once without doing it modularly.

Here is an article describing this paradigm.

  
http://www.gnu.org/software/coreutils/manual/coreutils.html#Opening-the-software-toolbox

The above is also in the coreutils info documentation.

  info coreutils 'Toolbox Introduction'

Bob

P.S. The best place for GNU coreutils specific discussions is on the
bug-coreutils mailing list.





Possibly Off Topic Rant

2009-03-01 Thread Ray Parrish

Hello,

I'm a fairly new user in Linux, and I've been studying and attempting to 
use the commands available to me at the command line by reading the man 
and info pages. I'm running into lots of problems determining the proper 
syntax for many of the commands due to very sketchy documentation.


I'm winding up trying some commands over and over again, as I attempt to 
discover the apparently secret twists to the syntax required to get a 
command to do it's thing. After many tries I sometimes finally get it 
right, and there is no mention in the docs of the requirement for the 
use of specific syntax options I eventually discover are required to use 
a command.


I consider this a bug in the documentation, and think it would be nice 
if the documentation writers would add a --verbose --verbose switch to 
their writing behaviors when producing man pages.


Later, Ray Parrish

--
Human reviewed index of links about the computer
http://www.rayslinks.com
Poetry from the mind of a Schizophrenic
http://www.writingsoftheschizophrenic.com/





Re: Possibly Off Topic Rant

2009-03-01 Thread Chet Ramey
Ray Parrish wrote:
 Hello,
 
 I'm a fairly new user in Linux, and I've been studying and attempting to
 use the commands available to me at the command line by reading the man
 and info pages. I'm running into lots of problems determining the proper
 syntax for many of the commands due to very sketchy documentation.
 
 I'm winding up trying some commands over and over again, as I attempt to
 discover the apparently secret twists to the syntax required to get a
 command to do it's thing. After many tries I sometimes finally get it
 right, and there is no mention in the docs of the requirement for the
 use of specific syntax options I eventually discover are required to use
 a command.
 
 I consider this a bug in the documentation, and think it would be nice
 if the documentation writers would add a --verbose --verbose switch to
 their writing behaviors when producing man pages.

There are literally hundreds of books available on Unix use, programming,
and shell scripting.  They fill this niche, not manual pages.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Re: Possibly Off Topic Rant

2009-03-01 Thread Ray Parrish

Chet Ramey wrote:

Ray Parrish wrote:
  

Hello,

I'm a fairly new user in Linux, and I've been studying and attempting to
use the commands available to me at the command line by reading the man
and info pages. I'm running into lots of problems determining the proper
syntax for many of the commands due to very sketchy documentation.

I'm winding up trying some commands over and over again, as I attempt to
discover the apparently secret twists to the syntax required to get a
command to do it's thing. After many tries I sometimes finally get it
right, and there is no mention in the docs of the requirement for the
use of specific syntax options I eventually discover are required to use
a command.

I consider this a bug in the documentation, and think it would be nice
if the documentation writers would add a --verbose --verbose switch to
their writing behaviors when producing man pages.



There are literally hundreds of books available on Unix use, programming,
and shell scripting.  They fill this niche, not manual pages.

Chet
  

Granted, and I've installed quite a few of them from the repositories,
but it would be nice if the man pages would at least mention things like
this parameter has to be quoted to work or use a * on the end of the
path to activate the --recursive option. It took me hours to find that
out with the ls command, see following output. -

r...@ray-desktop:~$ ls --recursive -d /proc/
/proc/
r...@ray-desktop:~$ ls --recursive -d /proc/*
/proc/1 /proc/4 /proc/8973 /proc/9826 /proc/fs
/proc/10012 /proc/41 /proc/8976 /proc/9828 /proc/interrupts
/proc/10018 /proc/44 /proc/8979 /proc/9829 /proc/iomem
/proc/10023 /proc/45 /proc/9041 /proc/9833 /proc/ioports
/proc/10025 /proc/4521 /proc/9059 /proc/9860 /proc/irq
/proc/10027 /proc/5 /proc/9060 /proc/9889 /proc/kallsyms
/proc/10029 /proc/5867 /proc/9083 /proc/9891 /proc/kcore
/proc/10050 /proc/6 /proc/9084 /proc/9897 /proc/key-users
/proc/10058 /proc/6101 /proc/9093 /proc/9902 /proc/kmsg
/proc/10060 /proc/6149 /proc/9105 /proc/9911 /proc/loadavg
/proc/10063 /proc/6190 /proc/9109 /proc/9916 /proc/locks
/proc/10066 /proc/6239 /proc/9203 /proc/9917 /proc/meminfo
/proc/10069 /proc/6254 /proc/9209 /proc/9921 /proc/misc
/proc/10077 /proc/7 /proc/9211 /proc/9922 /proc/modules
/proc/10083 /proc/7032 /proc/9213 /proc/9923 /proc/mounts
/proc/10106 /proc/7033 /proc/9224 /proc/9929 /proc/mtrr
/proc/10110 /proc/7037 /proc/9261 /proc/9957 /proc/net
/proc/10122 /proc/7038 /proc/9269 /proc/9960 /proc/pagetypeinfo
/proc/10126 /proc/7040 /proc/9272 /proc/9966 /proc/partitions
/proc/10159 /proc/7151 /proc/9273 /proc/9969 /proc/sched_debug
/proc/10207 /proc/7191 /proc/9282 /proc/9972 /proc/scsi
/proc/164 /proc/7270 /proc/9290 /proc/9975 /proc/self
/proc/1826 /proc/7338 /proc/9297 /proc/9978 /proc/slabinfo
/proc/1829 /proc/7340 /proc/9339 /proc/9995 /proc/stat
/proc/1843 /proc/7374 /proc/9342 /proc/acpi /proc/swaps
/proc/1849 /proc/7402 /proc/9346 /proc/asound /proc/sys
/proc/2 /proc/7416 /proc/9502 /proc/buddyinfo /proc/sysrq-trigger
/proc/203 /proc/7429 /proc/9530 /proc/bus /proc/sysvipc
/proc/204 /proc/7449 /proc/9680 /proc/cgroups /proc/timer_list
/proc/2408 /proc/7450 /proc/9684 /proc/cmdline /proc/timer_stats
/proc/2412 /proc/7479 /proc/9719 /proc/cpuinfo /proc/tty
/proc/245 /proc/7754 /proc/9776 /proc/crypto /proc/uptime
/proc/2679 /proc/7874 /proc/9790 /proc/devices /proc/version
/proc/2681 /proc/7911 /proc/9797 /proc/diskstats /proc/version_signature
/proc/2926 /proc/8646 /proc/9800 /proc/dma /proc/vmcore
/proc/2929 /proc/8934 /proc/9803 /proc/driver /proc/vmstat
/proc/3 /proc/8935 /proc/9804 /proc/execdomains /proc/zoneinfo
/proc/3046 /proc/8945 /proc/9808 /proc/fb
/proc/3760 /proc/8970 /proc/9815 /proc/filesystems
r...@ray-desktop:~$

And as another note, even 'though I've used the -d switch to show only
directories in the output I'm still getting filenames with it. I also
expected the command to keep recursing into the subdirectories of /proc/
and list the directories there, but no such luck. What gives? Here's
what the man page says -

-d, --directory
list directory entries instead of contents, and do not dereference
symbolic links

-R, --recursive list subdirectories recursively

I still don't know how to get it to dig deeper and give me all of the
subdirectories, or how to get it to actually output only directory names.

And you wouldn't believe the amount of time it took me to formulate the
following command to get what I wanted.

find -maxdepth 1 -printf '%f %T+\n' | sort -s -t ' ' -k 2.1nr -k 2.6n -k
2.9n -k 2.12r -k 2.15 -k 2.18

From the find man page below you will note that it doesn't mention the
fact that the printf parameters need to be quoted to work.

-printf format
True; print format on the standard output, interpreting ‘\’
escapes and ‘%’ directives. Field widths and precisions can be
specified as with the ‘printf’ C function. Please note that
many of the fields are printed as %s rather than %d, and this
may mean that flags don’t work 

Re: Possibly Off Topic Rant

2009-03-01 Thread Mike Frysinger
On Monday 02 March 2009 00:22:15 Ray Parrish wrote:
 but it would be nice if the man pages would at least mention things like
 this parameter has to be quoted to work or use a * on the end of the
 path to activate the --recursive option. It took me hours to find that
 out with the ls command, see following output.

the shell expanding * has nothing to do with any specific command.  like Chet 
said, that's a basic premise of using a *nix system that any half decent book 
out there would cover.

 And as another note, even 'though I've used the -d switch to show only
 directories in the output I'm still getting filenames with it. I also
 expected the command to keep recursing into the subdirectories of /proc/
 and list the directories there, but no such luck. What gives? Here's
 what the man page says -

this is the bash list, not coreutils (which owns the ls program).  if you 
want clearer info there, talk to them.

 And you wouldn't believe the amount of time it took me to formulate the
 following command to get what I wanted.

 find -maxdepth 1 -printf '%f %T+\n' | sort -s -t ' ' -k 2.1nr -k 2.6n -k
 2.9n -k 2.12r -k 2.15 -k 2.18

  From the find man page below you will note that it doesn't mention the
 fact that the printf parameters need to be quoted to work.

yet another basic issue not specific to any command.  reading a book would 
address this.

 And here is the skimpy info in the sort man page for the -k parameter. -

sort is from coreutils, not bash.
-mike


signature.asc
Description: This is a digitally signed message part.