Pages

Friday, September 27, 2013

syntax error at abc.pl line 10, near "$h ("

Perl language have bit different mechanism when dealing with errors. Some points you should know before debugging errors. 1)Always use shebang statement with  -w option as shown below. #!/usr/bin/perl -w 2)Always use strict and warnings package to report all syntax errors. use strict; use warnings; When you get above error do not just check error on the given line try to check before and after the line of error report. This tip will resolve most of your errors like missing closing brace "}", sentence termination like ";", etc. ...

Can't find string terminator "EOF " anywhere before EOF at test.pl line 21.

This issue will come when you are using EOF or EOM string to send multiple line to a perl print statement or a command. Just have look at below code I have a file descriptor which will take input from a string as shown below. printf FD1 "this my first line"; This will work with out any issue, but when you want to send multiple lines as shown below we have to use PERL here-docs as shown below. printf FD1 << EOM; statement1 statement2 EOM other than this syntax, if you give any other thing it will fail. Observe that there is no double...

Tuesday, September 17, 2013

Can't open /dev/sdb1 exclusively. Mounted filesystem?

This is an issue we will get for many reasons, one reason we get this error is when we try to use the partition which is already mounted or used in your machine. This occurs some times due to LVM which is not properly implemented If you fee this is new partition and want to unlock the file from kernel follow below steps Step1: Check what are the partitions known to the kernel by using proc file system as shown bleow [root@gnani surendra]# cat /proc/partitions major minor  #blocks  name    8        0...