Questions tagged [syntax]
64 questions
53
votes
2 answers
Should I use semicolons at the end of each PowerShell statement?
I've done a fair bit of programming in C#, but then I've also written a lot of T-SQL scripts. C# requires semicolons, and T-SQL and PowerShell they're optional. What do you do for PowerShell? Why? My gut feel is to include semicolons but I don't…
Mark Allison
- 2,098
- 7
- 26
- 45
40
votes
4 answers
What's wrong with my cronjob syntax, I'm trying to use a backtick (`)?
Here's what I'd like to automate:
00 08 * * * psql -Uuser database < query.sql | mail somone@null.com -s "query for `date +%Y-%m-%dZ%I:%M`"
Here's the error message:
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c:…
Terry G Lorber
- 565
- 2
- 7
- 12
11
votes
2 answers
How to interpret the bash command "usage" syntax?
How exactly do you have to interpret the output of a commands "usage" output, in bash for example.
For example, on my OS X, cp gives me
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi |…
raoulsson
- 4,633
- 10
- 32
- 29
10
votes
2 answers
BIND/DNS Zone meaning of "IN"
I have been reading http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-bind-zone.html but the document raised a question. What is the meaning of IN? Is it just a class which is optional or does it mean more than that?
(Yes I read that in…
elhombre
- 425
- 1
- 8
- 18
8
votes
5 answers
How can I perform a syntax check on an .htaccess file in a shared hosting environment?
I have a build script (Perl) that modifies the .htaccess file when I deploy my applications. As a double-check, I'd like to be able to perform some sort of syntax checking on the created .htaccess file.
I am familiar with the idea of using apachectl…
Danny
- 311
- 3
- 10
5
votes
1 answer
Poweshell escaped wildcard
I'm trying to compare string which contains wildcard character.
("www.mysite.*" -match '`*')
But something is not working because I always get a True response, for example
("www.mysite.com" -match '`*')
I've tried using -contains instead, but…
Miquel Àngel
- 75
- 1
- 4
4
votes
1 answer
Is There a Difference in Methods of Command Execution in a Subshell?
I wonder if there is a significant difference of calling sub shell via $(...) or `...`?
For example:
a=$(ls -la /tmp | grep vox-*)
And:
a=`ls -la /tmp | grep vox-*`
The result will be the completely the same, but I want to know why there are two…
Dima Zyuryaev
- 55
- 5
3
votes
4 answers
How to fix Puppet fully-qualified parameter path error?
I regularly but randomly get the following error message when I run the puppet client on machines (non-daemonized):
err: Could not create : Parameter path failed: File paths must be fully qualified
warning: Not using cache on failed…
David Gardner
- 1,499
- 2
- 13
- 25
3
votes
3 answers
Debian network bridge configuration - /etc/network/interfaces
I'm running a Lenny Xen dom0 hosting multiple virtual machines in a routed IP setup. To get an additional private subnet, I created the bridge xenbr0 in the dom0 with the following commands:
brctl addbr xenbr0
ifconfig xenbr0 10.0.0.1 netmask…
maff
- 311
- 1
- 4
- 14
3
votes
1 answer
Ansible -- The offending line appears to be:
I'm trying to implement a playbook to grab the external IP address at a few locations but it keeps giving me this same error:
The offending line appears to be:
remote_user: pi
tasks:
^ here
I've messed around with the indentation a…
Brian Lamb
- 41
- 3
2
votes
1 answer
Various "Config variables" not defined, Apache 2.4.18
I have been setting up a blog/cloud server on Ubuntu 16.04 with Apache 2.4.18 and after rebooting my machine, came across this error.
[Wed Aug 03 01:04:41.468928 2016] [core:warn] [pid 3191] AH00111: Config variable ${APACHE_LOCK_DIR} is not…
alexrocksdude
- 21
- 1
- 3
2
votes
1 answer
mail: Cannot parse address
This is the command I use to tar my backup files, write to stdout and then upload everything to Amazon S3 with an email notification.
tar -czvf - --exclude-caches /var/www | s3cmd --reduced-redundancy --multipart-chunk-size-mb=30 put -…
MultiformeIngegno
- 1,627
- 9
- 24
- 31
2
votes
1 answer
Postfix header_checks syntax (POSIX - Perl)
I am using header_checks in Postfix to rewrite my headers (for emails sent by Outlook through my server).
Here is the part of the header I am trying to change :
Received: from Raphasus (****.abo.wanadoo.fr [***.***.***.109])
by mail.********.com…
Raphael Laurent
- 219
- 1
- 6
- 17
2
votes
5 answers
debian bash/sh string execution
I am stuck with this piece of code here
user@server:~$ TEST="ssh rsync@otherserver.example.org 'date; hostname -A; uname -a'"
user@server:~$ $TEST
bash: date; hostname -A; uname -a: Command not found.
I want to use this inside a shell script an…
Daywalker
- 485
- 5
- 25
2
votes
1 answer
Why can't I select from a table named range without using backticks?
I'm facing a problem with mysql. A query select * from range; works on mysql 5.0.22 but does not work mysql 5.1.61. but it works with backtick:
i.e.
select * from `range`;
Kindly help in this regard.
I want mysql 5.1.61 to execute the query…
User4283
- 781
- 3
- 10
- 25