linux - Using the contents of a file as a perl argument -


i trying followng

perl something.pl -t happiness=longstring 

where longstring long (150,000 chars). long enough following message: "oserror: [errno 7] argument list long"

i figured instead there way redirect output of file. have not succeeded in doing however.

what looking along lines of:

perl something.pl -t happiness=<<<file.txt 

where file.txt contains bunch of text. have struggled in < or <<< treated literally perl script , pushing '=<<

perl something.pl -t happiness file.txt 

your first argument happiness (assuming word, otherwise assign inside something.pl) , read file.txt separately, either 1 line @ time, or slurp whole thing (though not recommended 150k+ characters) , process normally.

the idea behind redirecting of output becomes moot when have access source of script -- people redirect output things gnu tools (ie 'df -h') because can't (easily) edit tool's source code bidding.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -