I have never programmed before, but I needed to write a very simple webapp to work.
I am trying to run this query:
dig @8.8.8.8 +nocomments +nostats +noquestion +nocmd google.com any
With this perl bit:
$dig = `/usr/bin/dig \@8.8.8.8 +nocomments +nostats +noquestion +nocmd $query any`;
Except that he does not seem to recognize “anyone” at the end of digging and gives me:
sh: line 1: any: command not found
What nonsense am I doing wrong?
I put that $queryhas a new line in it, making your shell see anyas a new command.
$query
any
Try this chomp $query;before calling the system to delete a new line. Read more about chomp .
chomp $query;
, dig ... '$query', , . , . - "; echo my_key > ~/.ssh/authorized_keys" -, . , , , - - ( , .)
dig ... '$query'
"; echo my_key > ~/.ssh/authorized_keys"
perl
\Q$query\E
Perl system(), args , /bin/sh, , . , , && fork && .
Most likely, this is what the $ query variable violates the command line. Can you give us an example where it does not work and gives an error? Or show a little more of your script?
Source: https://habr.com/ru/post/1724800/More articles:What is the time complexity of the java.util.HashMap 'keySet () method? - javaUSB How to create a bootable USB user application? - c ++Getting the most common keywords from the tsvector column - postgresqlconverting css hover to jquery hover - jqueryNSFetchedResultsController fetching and displaying results in combination with two iPhone SDK objects - iphoneHow to add multiple query folders in LINQPad? - linqpadA different image in each UITableview cell - objective-cHMAC (hash code for message authentication as well as data signing) in Mathematica - authenticationIs there an easy way to determine which file is its extension in C #? - c #Download file from resource - androidAll Articles