Stack Exchange Network

Stack Exchange network consists of 174 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]

Syntax refers to the rules of programming languages which stipulate how code is to be arranged so that the structure is syntactically correct and can be executed successfully in the particular framework of those languages.

11
votes
2answers
1k views

Run another command when previous command completes [duplicate]

Today I opened gnome-terminal and I wrote ls && sleep 4 && gnome-terminal to open another terminal after the completion of ls command and waiting for 4 seconds. So it successfully ...
2
votes
1answer
109 views

How to install Maxima and make syntax on Ubuntu Server 18.04

How to install Maxima computer algebra system, and make a syntax like the screenshot that is shown below? What is a similar application to Maxima that can run from the command-line in Ubuntu Server 18....
0
votes
1answer
61 views

Syntax for keyboard shortcuts

What is the proper syntax for adding keyboard shortcuts in xfce4? From the existing shortcuts, I noticed that every shortcuts command is not the same. Different kind of syntax is used for different ...
1
vote
2answers
82 views

How do you get a *.desktop file to work for a non-repository app?

I turned the Amazon cloud reader site https://read.amazon.com into a desktop app with nativefier. It works amazingly well as a standalone reader for books that have been downloaded and also ...
0
votes
1answer
339 views

Must apt-get install software-properties-common precede ppa:X?

This is how I currently install some basic software in my Ubuntu 18.04 server environment. I am afraid I might have some redundancy here: apt-get update -y apt-get install software-properties-common ...
0
votes
1answer
148 views

Python syntax error with awk, sprintf statment (2.7)

I am trying to use one of the shell commands to a python script, but struggling with some syntax error here. The description of the command is from here echo /dev/bus/usb/`udevadm info --name=/dev/...
6
votes
1answer
360 views

What does the syntax of pipe and ending dash mean? [duplicate]

Disclaimer. I'm a long-time Windows user and just starting to get my head around the Linux paradigm. While excited by it, I understand that my formulations might be poorly chosen due to ignorance. I'...
1
vote
0answers
42 views

Can't save my sudoers.tmp file after correcting syntax error

I know there are a lot of questions regarding sudoer and sudoers.d directory, but i can't find the answers for my specific problems: There is a syntax error on every line (in both sudoer and sudoers....
-5
votes
1answer
624 views

“pip install pyarrow” returns syntax error [closed]

i already try to use linux cod on python.with importcommand.whats your idea to improve .do I use .os to import? how do i use it to install pyarrow in python.how can I install it atlink like windows ? ...
0
votes
1answer
172 views

Installing driver

I've been trying to install some intel drivers, but I get an error message. This is the text: alberto@alberto-Inspiron-5558:~$ cd Desktop alberto@alberto-Inspiron-5558:~/Desktop$ chmod a+x ...
0
votes
0answers
429 views

Two errors: unexpected EOF while looking for matching `'' and syntax error: unexpected end of file

#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; } My current Ubuntu version is 17.10 I saved the above C++ program on my ...
0
votes
0answers
97 views

syntax error near unexpected token `Geant4'

I'm installing "Geant4" on Ubuntu 17.10 amd64 bit. In step "CMake Build System: Geant4Config.cmake", I got error! who can help me to fix it? find_package(Geant4) bash: syntax error near unexpected ...
1
vote
0answers
20 views

Pluma/Gedit REMOVE languages

I like to remove most of the languages from the pluma/gedit menues, where they show up. It's great that the editors support so many languages. But most of them I never use. So they are only in the ...
1
vote
1answer
74 views

Space literal as function name in bash

This question is loosely related to one of my previous ones. TL;DR from muru's answer is that characters in function name have to be on Portable Character Set in order to be valid for a function name. ...
-2
votes
2answers
655 views

line 56 syntax error: unexpected end of file

I have typed out the code for this mychoice.sh bash example and I keep getting the syntax error: unexpected end of file. Am I missing something? mychoice.sh #!/bin/bash E='echo -e';e='echo -en';...
1
vote
2answers
5k views

How do I send GET and POST requests using Curl?

How do I send GET and POST requests with parameter gimmeflag and value please to the URL http://103.200.7.150:7777/ using curl on the command line?
0
votes
0answers
467 views

“sudo apt-get update” command gives Syntax error in Ubuntu 16.04

On entering the above command [sudo apt-get update], I get the following error: Syntax error /etc/apt/apt.conf.d/99force-ipv4:5: Extra junk at end of file Can someone help me pls. Thanks
-1
votes
1answer
244 views

How do I make a shell script loop through multiple if statements forever?

I've made a shell script based on a bunch of snippets and tutorials I've read. I just can't figure out how to fix a syntax error and make it work. Terminal output is: ./afkscript.sh: 2 ./afkscript.sh:...
0
votes
1answer
862 views

Errors were encountered while processing: install-info

$ sudo apt-get install wondershaper python-qt4 arp-scan dsniff arptables Reading package lists... Done Building dependency tree Reading state information... Done python-qt4 is already the ...
0
votes
0answers
111 views

Error: You must specify exactly one target process

what is the syntax to use cpulimit to throttle Web Content? Note the space between Web and Content. top - 09:16:00 up 1:09, 2 users, load average: 1.80, 1.70, 1.77 Tasks: 215 total, 2 running, ...
1
vote
1answer
876 views

what does the -aux option of ps stand for?

You often pass options to CLI commands which cause the function to behave differently. They all have a meaning, for example -v means "Verbose" -l means "List" The ps command lists all running ...
15
votes
3answers
4k views

What does this syntax mean?

I am new to terminal and trying to learn how to use it. What do these lines do? And how do they work? echo -n "Today's date is: " date +"%A, %B %-d, %Y"
0
votes
0answers
40 views

Need to know about “ . ” Symbol? [duplicate]

There is a command if [ -f ~/.bashrc ]; then . ~/.bashrc I need to know why there is "." right before ~/.bashrc?
12
votes
2answers
3k views

For loop with Alphabet

This works perfectly on OSX #!/bin/bash chars=( {a..z} ) n=3 for ((i=0; i<n; i++)) do echo "${chars[i]}" done But when I run it on Ubuntu, I get the following error. ForLoopAlphabetTest.sh: 2: ...
0
votes
1answer
969 views

“E: Syntax error /etc/apt/apt.conf.d/10periodic:7: Extra junk at end of file” how to trouble shoot this? [duplicate]

I typed sudo apt update in terminal, then I got the following error: E: Syntax error /etc/apt/apt.conf.d/10periodic:7: Extra junk at end of file The file contains: 1 # 2 # Xilinx Clocking Wizard ...
0
votes
1answer
2k views

Can't uninstall PHPmyadmin in Ubuntu 16.04

My PHPmyadmin (PMA) install was stuck. I started a new session and when doing apt-get purge phpmyadmin I got: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)...
0
votes
0answers
932 views

Filtering Terminal Output and Writing to File

I have following command : sudo evtest /dev/input/event3 I filter the output using sudo evtest /dev/input/event3 | grep 'type 1', works fine I want to write the output to file, and tried multiple ...
0
votes
3answers
615 views

how to extract MAC data from grep and insert into bash

I'm trying to extract the MAC address for a wireless card then insert it into a bash script as a VAR variable with an incremental change. So.. $ ifconfig wlan1 | grep HWaddr wlan1 Link encap:...
0
votes
1answer
25 views

When would multiple `///` be used between sub-directories?

I was digging through /var/log/plymouth-debug.log and spotted this line: [main.c:716] get_cache_file_for_mode:returning cache file '/var/lib/plymouth//boot-duration' I thought it was a typo so typed ...
0
votes
0answers
311 views

Syntax error /etc/apt/apt.conf.d/99ignoresave:1: Extra junk after value

The problem I'm facing now is pretty much the title's question. I was trying to install my restricted extras but ended up failing. Everything was okay until I rebooted and when I opened my terminal to ...
5
votes
1answer
2k views

Can I enable bracket matching in nano?

else if( d && ( (d <= b && d <= s) || (!b && !s) ) smallest = d Consider this piece of code of C++. Can we have bracket matching (highlighting opening bracket when ...
2
votes
0answers
177 views

Colored syntax and terminal when using SSH from terminal

Ok. So I use pico as a text editor. In ubuntu and when I ssh using putty I have colored syntax and colored terminals. When I ssh through ubuntu terminal I have solid white text. I always ssh into my ...
7
votes
2answers
1k views

command output redirection using '-< <( … )'

I needed to extract a shasum. This works, but can anyone explain why? sed 's/^.*= //' -< <(openssl dgst -sha256 filename) I'm familiar with the $( ) construct, but can't find docs for <( ), ...
0
votes
1answer
3k views

-bash: syntax error near unexpected token `&'

I get this error (-bash: syntax error near unexpected token `&' ) when I run the command below: sudochown -hRfwebadmin:www-data /web/<repertoire>&&sudoln -s /web/<repertoire&...
0
votes
1answer
401 views

strange command prompt error

Whenever I have two command prompts open I always get this script coming up after I execute the commands. Just to clarify the commands execute and output correctly but after the out put before the ...
1
vote
2answers
857 views

line 42: syntax error: unexpected end of file [closed]

I'm relatively new to bash scripting so bare with me but I need some help. I feel like i have all the right stuff there but it ain't quite going. I'm attempting to make a simply security log in the ...
0
votes
1answer
34 views

Does MonoDevelop's syntax deviate from VisualStudio's

I'm an IT student and we started learning C# this semester, we are working with VisualStudio 2012 in class. Since I installed ubuntu recently I do not know much about anything, but I like it very much....
0
votes
1answer
331 views

LFS Troubles - Applying Patch in Section 5.7.1 [closed]

Apologize in advance if this has been asked before, and if it is very obvious. I'm following the guide pretty literally at this point to get started. The page in question is this: http://...
3
votes
3answers
565 views

if command syntax

My code of shell script is as follows: echo "Enter file name"; read fname; if [-f$fname]; then echo "File already exists"; fi` However, when I run my script, I get this error: [-ffile]: not ...
0
votes
1answer
720 views

why does ls -Z returns files names with question marks next to them?

why does ls -Z returns files names with question marks next to them? And what does this command do?
1
vote
1answer
1k views

Conditions and ranges within case statements in bash

I was writing a plugin for Nagios to check the number of security packages and doing a case statement as the one here. but the whole thing ended up turning into a freak show. All I basically wanted ...
9
votes
1answer
1k views

Brackets, Braces, Curly Brackets in Bash

Here goes the riddle: If I do: touch file{1,2,3} It creates file1, file2, file3 And if I do rm file[1-3] It deletes them. but if I do touch file[1-3] it creates: file[1-3] Why?
1
vote
1answer
444 views

Gnuplot script bash problem

I have wrote this script in bash for f in $FILES do echo "Processing file... $f" # take action on each file. $f store current file name B=$(basename $f) filename="${B%.*}" mkdir $BASEDIR/$...
-1
votes
2answers
173 views

substitute values in one text file into another text file

I want to use awk to create a text file that includes a series of awk text lines with numbers that are replaced in. problem i am having is that the text will include awk syntax. ultimately, i want to ...
15
votes
2answers
872 views

What's the missing argument to -exec?

I use the following command to clear a directory, of files and directories over 30 days old, and move them to an archive directory which I can delete after a few weeks if nobody asks for their files ...
1
vote
1answer
87 views

I cannot get grep to print results

Total noob here. I am blindly stumbling my way through bash. I realize that there is a syntax error in the following script but, I cannot figure it out. The script just sits there. #!/bin/bash mac=`...
0
votes
2answers
1k views

PHP Fatal error: Cannot redeclare [ By using php -l in terminal]

I wrote the php script and gone for syntax check via terminal php -l my_filepath, then suddenly found fatal error PHP Fatal error: Cannot redeclare even my code executing successfully. also check on ...
2
votes
1answer
338 views

How to calculate Pi decimals from a given offset?

I am using http://packages.ubuntu.com/lucid/math/pi to calculate Pi decimals. Let's say I want only decimals from the 3rd decimal to the 5th decimal. man pi says it is possible to enter an interval ...
9
votes
6answers
6k views

What is the point of the bash Null-operator “:”, colon?

What is the point of the "null" operator in a BASH script? I understand that it is used as a placeholder following an if command when you have nothing to say, but need a command to allow the program ...
3
votes
1answer
2k views

Can you do dictionaries in qml?

So for example: Item { id: sylvainLikesAnsweringMyQuestions property var myDict: {[key,value],[anotherKey,anotherValue]} }