LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Help w/ script to read file and parse variables (https://www.linuxquestions.org/questions/linux-general-1/help-w-script-to-read-file-and-parse-variables-504054/)

cslink23 11-25-2006 09:51 AM

First of all, "whereis" is is "not found". But, as I've said before, the shell is "/bin/sh" so I know the location. "ls -l /bin/sh" yields:
#ls -l /bin/sh
lrwxrwxrwx 1 root root 30 Dec 6 1998 /bin/sh -> /opt/K/SCO/Unix
/5.0.5Eb/bin/sh

which seems to indicate that this is just a plain "sh" shell. But, I don't think it helps to establish the version and the capabilities of this shell.

I appreciate all of your help. I'll just live with the wc -l to verify the records were written correctly.

Thanks again.

cslink23 11-25-2006 01:10 PM

I have no "whereis" but, as I said before the /etc/passwd file shows that each user is assigned /bin/sh. So, I know the location of the shell. "ls -l /bin/sh" yeilds:
#ls -l /bin/sh
lrwxrwxrwx 1 root root 30 Dec 6 1998 /bin/sh -> /opt/K/SCO/Unix
/5.0.5Eb/bin/sh

which doesn't seem to help much. I can live with the current solution and use "wc -l" to verify all lines were written.

Thanks for all of your help.
Link

cslink23 11-25-2006 01:12 PM

Sorry. I didn't see the second page so I posted again.

Sepero 11-26-2006 02:22 AM

Quote:

Originally Posted by cslink23
#ls -l /bin/sh
lrwxrwxrwx 1 root root 30 Dec 6 1998 /bin/sh -> /opt/K/SCO/Unix/5.0.5Eb/bin/sh

SCO... that brings back memories. :)

Here is a possible solution:
count=`expr $count "+" 1`

The last option would be using some program like "dc" or "bc" to perform the math.


All times are GMT -5. The time now is 02:28 PM.