I am fiddling with a little script that will issue a shutdown command if the temperature on the CPU goes above a certain level. I started writing the script in Bash, and then thought I would like to use Perl to extract the detailed bits, but I am not sure if this is really practical. Basically I want to parse the input a little better, but I am a bit of a novice at both Bash and Perl. I know how to extract what I want with Perl, but not so much with Bash. I know how to get the raw data with Bash, but I don't know how best to get that data to Perl, and then back as a variable to Bash so it can decide whether to leave the machine running, or issue a shutdown command. I wrote the first bit of the Bash script, which was relatively simple, but now I am at a standstill as I don't know how to bring Perl into the picture. Would my best bet be to write the 'raw data' to a file, and then call a separate Perl script, have it alter the file data as necessary, then read in the newly parsed data (in Bash) and act on that? Here is what I have gotten so far:
I have the below perl script that runs (I think):
'C:\Users\cmccabe\Desktop\annovar\matrix.pl' < "${id}".txt.hg19_multianno.txt > "L:\NGS\3_BUSINESS\Matrix\Torrent\matrix_${id}.txt"
The problem is I get an error that the ${id}.txt does not exist. I have tried "${id}.txt as well. ... (42 Replies)
I've building a bunch of bash scripts, and am thinking about "converting" to perl, and have a couple questions first:
1. Is there anything bash will do that perl won't?
2. How steep is the learning curve?
3. If perl's more powerful, why?
4. I've built a small app in python, which seemed nice,... (18 Replies)
Hi there,
if you want to write an application partly in C and partly in Perl and have a final executable binary is it possible to do so. If yes, how ?
My motivation for asking this question is that there are certain tasks that are so tedious to write in C while it can be taken care of in Perl... (2 Replies)
can any body translate the follwing script into one that works in bash?
#!/usr/bin/perl
# classify_books.pl
my $csv_file = shift;
my %categories = ( 'childrens' => 'childrens_books.txt',
'horror' => 'horror_books.txt',
'sports ' =>... (3 Replies)
Hi guys,
I am converting a bash script to perl. I need lots of help and pointers on how to make the script work. Any help would be greatly appreciated. Here is what I have:
#!/usr/bin/perl
#Decrypt Files
$dir = "/usr/bin/gpg;
opendir(PGP_DIR, $dir) || die "can't opendir $dir: $!";... (3 Replies)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)