Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [syntax]

Questions about the particularities in the symbols that commands and programming languages require for a proper structure.

178
votes
5answers
91k views

In bash, how do I escape an exclamation mark?

I want to do something like bzr commit -m "It works!". I can sort of escape the exclamation mark by doing bzr commit -m "It works\!". However, then my commit message includes the backslash. How do I ...
38
votes
4answers
16k views

In a URL, what is // for? [closed]

Typically, when I see //, it's usualy following some protocol prefix like http: or ftp:. I have never seen it placed anywhere else. For example, http://www.google.com/ is a typical URL. However, ...
17
votes
4answers
3k views

Difference between '{}' and {} in find command?

In the documentation, I see usage both ways: find . -type f -exec file '{}' \; find repo/ -exec test -d {}/.svn -o -d {}/.git -o -d {}/CVS ; \
16
votes
3answers
7k views

How to read Unix usage

I did some searching, but I cannot find documentation on how Unix usage works. I know something (mostly through trial and error) but, for example, how do I know that /usr/bin/ls [-...
15
votes
1answer
10k views

Custom gedit Syntax Highlighting for Dummies?

I want to make (have, actually) a custom syntax highlighting for gedit. There would be just a few different items: A line that begins with 2 tabs. ----- One color. A line that begins with 3 tabs. ---...
13
votes
1answer
9k views

crontab day of week vs. day of month?

I added this to /etc/crontab on a few different linux & freebsd systems: # monthly reboot: 3rd Tuesday of every month 56 07 15-21 * 2 root /sbin/shutdown -r now I want a reboot on the 3rd ...
12
votes
5answers
11k views

How is \$ being interpreted by grep?

When I write $ grep \$ then whatever I type on terminal, is matched and printed on terminal. How is \$ being interpreted?
12
votes
1answer
5k views

HTML - Historical or technical reason for target=“_blank” with underscore?

Until today I am wondering why target="_blank" has not become target="blank". I am sure the browsers could understand this as well. Are there any historcal or technical reasons for this decision / ...
11
votes
2answers
8k views

Vim: What do these short names / verbs like <leader>, <C-r> mean?

I'm using Vim for a while now, starting to like it more and more. But when searching for some new features that Vim has in it's goodie bag, I'm often slapped in the face with things like <Leader>...
11
votes
2answers
15k views

How can I see the available Windows Search Filters?

I've often wondered how to use Windows Search Filters. The available documentation is extremely limited, but its potential uses are quite large. When I type something, the only search filters I see ...
11
votes
2answers
6k views

Program for creating language syntax/grammar “railroad” diagrams? [closed]

I'm looking for the program that JSON, SQLite and other projects are using to create the diagrams used for their language syntax, if there is a particular program. All of the diagrams have a similar ...
9
votes
2answers
23k views

How can I sort ls by owner and group?

How can I list directories with ls and sort them by their owner and group?
9
votes
2answers
4k views

What bash < < syntax mean?

Ruby Version Manager (RVM) installed like so: bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) I understand what first < mean (feeds bash ...
7
votes
5answers
9k views

Explanation of command to uppercase the first letter of a filename

I'm trying to learn to rename files with the command line, and after browsing around a lot of pages I finally found a command that uppercases the first letter of a file, but the problem is that I want ...
6
votes
2answers
4k views

Syntax for find on Mac OS X

I have a project directory that contains source code and subdirectories of source code. I want to use the Unix program find to search recursively for the names of files of certain extensions. The ...
6
votes
2answers
6k views

How to 'code collapse' wiki syntax on Notepad++ (or any other text editor)?

I'm familiar with Notepad++'s code collapse for certain programming languages but recently I've been working with a plain text file that uses with Wiki syntax. For example: ==Heading1== Content ===...
5
votes
9answers
871 views

“Syntax” Highlight a flatfile

I've googled and looked and explored, but it seems most editors configurable syntax highlighting definitions are based on keywords and such. I need one that is based on columns and lines, basically ...
5
votes
1answer
3k views

Fix YAML syntax highlighting in VIM

The YAML syntax highlighting in Vim 7.3 isn't great. Putting an apostrophe in a line of text triggers quote highlighting even when there's no quote. The same thing happens in other files sometimes too....
4
votes
5answers
795 views

How do I pipe a list of numbers straight from the shell into a command?

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this [1,2,3,4] | sort would give 1 2 3 4 EDIT: In response to the answers kindly posted so far ....
4
votes
1answer
7k views

How to grep a line start with “*” using grep

How can I use 'grep' to get lines start with '* ' in my file? I tried grep "*" myfile and grep "* " myfile but returns all the lines of my file.
4
votes
2answers
10k views

cat “input file is output file” while trying to combine multiple files into one

The plan was to collect all source lines of Java into one file, recursively: $ find . -name '*.java' | xargs cat >> all.java But there was an error: cat: ./all.java: input file is output file ...
4
votes
2answers
4k views

How to set syntax specific settings in my VIMRC?

I work with several languages and markups in vim every day (ruby, python, javascript, CSS, HTML, etc), and would like to have different settings for each buffer when I fire up my editor. How can I ...
4
votes
3answers
9k views

Checkbox in Mediawiki syntax?

Is there a way to insert an HTML checkbox in Mediawiki syntax? <input> doesn't appear on their list of blessed tags, so I can't just insert it. (FWIW, this is for a private documentation page ...
4
votes
2answers
3k views

Vim syntax highlighting lost on single file

I have a strange thing happening on a single file. When I open the file under it's original name, the highlighting is lost (":syntax on" does nothing). But if I cp that file with another name and open ...
4
votes
1answer
13k views

Matching a number sequence in grep

So I'm trying to match a year number sequence with grep and this should be easy. I'm just a bit stumped that my simplistic regex isn't working. What I'm doing is running a tool which archives some ...
4
votes
3answers
2k views

how do I use tar -C on Snow Leopard when creating an archive?

The man page states -C directory In c and r mode, this changes the directory before adding the following files. However, tar does not change to the directory I specify, but instead reports ...
3
votes
3answers
543 views

Launch VIM and show, or hide, row numbers

Background Control whether row numbers are displayed after vim starts (in a non-interactive mode). Problem A shell script contains the following code: echo Converting $1 to $1.html... NUMBERS="-c ...
3
votes
2answers
2k views

eclipse non-extension file syntax highlight

Computer software question: I have bash files that have no extension. How can I have its syntax highlighted in Eclipse. I already have ShellEd installed. Thanks.
3
votes
1answer
10k views

Only output header and summary with robocopy.exe

I'm using Robocopy and just want it to output the header and summary, hiding everything else. I've looked at the Robocopy syntax and have tried: /NC /NFL /NS /NDL /NP However I'm still getting this: ...
3
votes
1answer
64 views

Why is Sublime Text 3.2 highlighting commas after values that start with “for” in Python dictionaries?

In the most recent version of Sublime Text (3.2 Build 3200), I have encountered what I think is a syntax highlighting error when writing in Python. Whenever I create a dictionary that has a key/value ...
3
votes
1answer
88 views

What does `@` represent when dealing with Windows registry keys?

What does @ represent when dealing with Windows registry keys? Examples:
3
votes
2answers
917 views

Windows Command line: Is there any way to check syntax of bat file without actually running it?

Windows Command line: Is there any way to check syntax of bat file without actually running it?
3
votes
1answer
80 views

What does this crontab line do?

What does this crontab entry do? I'm thinking it means run the jobs.sh script every Monday at 11AM. Is this correct? 0 11 * * MON /home/username/jobs.sh
3
votes
1answer
612 views

Vim: is it possible to add a modeline for :syntax sync fromstart in a file?

I'm writing a really long page to document a compiler and I was thinking that it would be nice if the doxygen highlighting would stick around. Only if I do a search to further down the file, it loses ...
3
votes
1answer
546 views

emacs auto-complete behavior with underscores in python mode

In my .emacs I have the following line of code: (modify-syntax-entry ?_ "." python-mode-syntax-table) This is so that commands like forward-word and backward-kill-word stop at any underscores that ...
3
votes
0answers
2k views

How can I block iframes with uBlock-origin?

I want to define a uBlock-origin filter for iframes on a certain website, whose sources is some other website. Is this possible? If so, what's the appropriate syntax?
3
votes
1answer
1k views

How to set the default language in Notepad++ for Rails View files

Similar question to this but my question goes a step further. I'm developing in rails and would like Notepad++ to automatically use html formatting on files with the extension html.erb. For example '...
2
votes
2answers
590 views

What is the difference between echo $BASH_VERSION and echo ${BASH_VERSION}?

I see a lot of ${VARIABLE} type syntax in scripts. What is the point of the braces?
2
votes
1answer
781 views

How to remove files using find's multiple -name parameter?

How to remove files, containing tilde in the filename or extension, recursively? For example, files of the vim, with the names like .my_file.c.un~? I'm using this find sequence for that: find . -...
2
votes
2answers
4k views

What about this Forfiles command syntax is wrong?

I was attempting to issue the following FORFILES command, and I recieved an error that distressed me (listed after the command). C:\Windows\system32>FORFILES /P %WINDIR%\servicing\Packages /M ...
2
votes
1answer
52 views

If “a:domain.com” is used, would it include emails sent from *@subdomain.domain.com address?

Supposedly I have example.com domain and would like it to allow mails sent from subdomain.domain.com. If the spf record should verify emails sent from *@subdomain.domain.com address (or mailed-by: ...
2
votes
3answers
147 views

WildCards corrupts Copy`s output file when an output name is specified

copy create's an almost empty (1K) file when a wildcard (*?) is used in the source & an output name is specified. copy /D /V *?ample.png %homepath%/example.png it works for some file types (....
2
votes
2answers
118 views

Make emacs show comments after } else {

This is best described on an example. Let's say you have the following C source file: if (something is true) { meh(); } else if (something else is true) { foo(); } else { // something even ...
2
votes
2answers
398 views

How to set syntax enable permanently in Vim

How do I make Vim to remember the syntax enable (or syntax on) command, so I don't have to type it every time I open a new file?
2
votes
2answers
194 views

How does calling a program in Windows XP from “Run…” with a colon argument work?

I noticed that a certain program works in a special way when sending an argument. The only way to send an argument is by clicking "Start -> Run..." and typing: [programname]:[argument] for e.g (...
2
votes
1answer
220 views

Vim match containedin not working as expected

I have tried to extend the C syntax in Vim with the example in the manual. First I launch vim without any config: vim -u NONE test.c Then I load the c-syntax and create my extension syntax on ...
2
votes
3answers
450 views

How to use wildcards to find the years between 1900 and now

I want to know the number of times that any year from 1900 through the current year is mentioned in a Word file. I know how to use a wildcard expression to do this in two steps as follows: <(19[...
2
votes
0answers
54 views

Extractor Information program by detecting syntactic patterns [closed]

I wonder if there is a program that helps you automatically extract information by setting syntactic patterns and save it in a base data.
2
votes
1answer
2k views

Automating Disk Cleanup on Windows using commandline

I am trying to run Disk Cleanup in the Command Prompt (and through a C# program) and so I went through all the available options from this link: http://support.microsoft.com/kb/315246 Whilst I am ...
1
vote
3answers
2k views

What is the meaning of pri=42

When mounting a swap partition on Linux, what does the mount option pri=42 mean? fstab: /dev/hda1 swap swap pri=42 0 0