Quote:
Originally Posted by jaybiano
@TBOne the output would be used for Lawson payroll system.
Thanks, i just started learning Bash scripting, i will look into perl and Python as well
When i excute the script i get this lines of error, is there a reason perl isn't work for me?
Code:
Can't locate Time/Piece.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at ./fileRead.sh line 4.
BEGIN failed--compilation aborted at ./fileRead.sh line 4.
|
This isn't a shell script (.sh)...this is a perl program, so name if "fileRead.pl" instead. While extensions don't matter to Linux, it *WILL* matter to you later, because you'll need to keep track of things, what they are and what they do. Something like "fileRead" isn't descriptive, so if you put this in a job scheduler, along with OTHER programs, make your life easy. Name it something like "LawsonFileConverter.pl" or something like that.
And you're getting that error because the Time::Piece module for perl isn't installed on your system. You don't say what version/distro of Linux you're using, but chances are it's in the repositories. And *AGAIN* when posting such output, you need to put it in CODE tags.
Quote:
if i do
Code:
#!/bin/bash ---- This works
But
Code:
#!/usr/bin/perl ----- Does not work
|
Define "does not work", please. If you're putting the actual "#!" in front of it, it won't....and if you just run /usr/bin/perl, it will only give you a blank line, since you're entered into the perl compiler...it's expecting you to put in code. Running /bin/bash only brings up a new shell, invisibly...your original shell is still running.