I have a file containing a long comma-delimited list of numbers, like this:
2,8,42,75,101
What's the simplest command (from a Unix shell) to get the count of numbers in this file? In the example above, that would be 5
.
I have a file containing a long comma-delimited list of numbers, like this:
2,8,42,75,101
What's the simplest command (from a Unix shell) to get the count of numbers in this file? In the example above, that would be 5
.
How can I make the ls
command show a file's full path instead of just its filename? With all its options, there must be a way, right?
Suppose I have an executable xyz that takes a variable number of command-line arguments, and a wrapper Korn shell script xyz.ksh. Is there an easy way to pass all of the shell script arguments as-is to the executable?
I'm trying to determine the location of an executable (java.exe) on Windows. I know it must exist somewhere in the PATH since I can run it, but I don't know the exact directory that it is being run from. On a UNIX system I could use the whence command to obtain this information. Is there an equivalent command for Windows systems?
Suppose I have an application running on a UNIX box that is failing with a system error status of '13'. Now, I can easily look up this value in errno.h, to find out that it is a permission-denied problem.
> grep -w 13 /usr/include/errno.h
#define EACCES 13 /* Permission denied */
Is there a simpler command to retrieve this information? I'd like to be able to run something like this:
> lookuperror 13
EACCES (Permission denied)
Instead of grepping system header files. Does such a command/program exist?
Update: As pointed out in the answers below, the strerror()
system call returns this information. Are there any UNIX operating systems that ship with an executable utility that makes this system call, or do I need to write my own program to do it?