Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Script languages: Max. Line Length

I have written a script which stores digital signatures in binaries and script files. This question is only regarding scripts: Currently, all these signatures get stored in one single line (a comment) such as:

#!/usr/bin/perl
print "Hello"
print " World\n"
#Signature:ASDASG13412sdflsal4sf etc........

The example is Perl, but this is done for all scripting languages (Perl, Python, shell scripts etc.) So now my question is: Can I get into trouble if the length of the line containing the signature is too long? How do interpreter handle this? If so, what is the max. line length I can use?

like image 423
Chris Avatar asked Apr 29 '11 07:04

Chris


3 Answers

Most scripting languages will have long enough limits, if indeed they have a formal limit on the length of lines. POSIX recommends 2048 minimum.

How long are your signatures? Most likely, not more than 1024...in which case, I really wouldn't worry. If it doesn't work for some language, you should report the bug rather than anything else.

like image 129
Jonathan Leffler Avatar answered Nov 14 '22 23:11

Jonathan Leffler


Perl also has no fixed maximum line length, other than imposed by memory usage.

like image 27
ysth Avatar answered Nov 14 '22 23:11

ysth


In Python, you should not have any problem with line length as long as you have sufficient memory. In PHP, you may be limited by the amount of memory PHP interpreter is allowed to use (set in php.ini)

like image 28
Imran Avatar answered Nov 15 '22 00:11

Imran