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.

Filter by
Sorted by
Tagged with
2
votes
2answers
168 views

Subtracting dates formats in bash

I am trying to create a countdown - most likely the hard way. I have it setup like this: #! /bin/bash #When to execute command execute=$(date +"%T" -d "22:30:00") #Current time ...
0
votes
1answer
28 views

syntax error, unexpected 'DB_PASSWORD' (T_STRING), expecting ')' in /etc/wordpress/config-localhost.php on line 4 [closed]

I have received this error message in the log file /var/log/apache2/error.log syntax error, unexpected 'DB_PASSWORD' (T_STRING), expecting ')' in /etc/wordpress/config-localhost.php on line 4 ...
0
votes
1answer
55 views

dpkg shows a curious syntax error while installing a package

While installing Brightness Controller from its ppa in Ubuntu 20.04, it shows an invalid syntax error Setting up brightness-controller (2.3.4-0~202004250741~ubuntu20.04.1) ... File "/usr/share/...
0
votes
1answer
61 views

How to solve SYNTAX ERROR

I was trying to install EGSnrc software and following the instruction from the web. But when I try to launch the installer ./EGSnrc-configure-linux this message showed up ./EGSnrc-configure-linux: ...
4
votes
3answers
541 views

How to fix ~/.profile and ~/.bashrc syntax errors

Ubuntu 18.04.4 (automatic upgrade from 18.04.3 just a few weeks ago) /bin/bash After I log in from the Gnome shell, this message appears while the screen is just plain purple and before the desktop ...
0
votes
1answer
97 views

Syntax error in ~/.bashrc if statement

In my terminal, it says that my .bashrc file possess a syntax error. I could identify this bit of lines from my .bashrc that were incorrect but cannot fix it. This is the part of my .bashrc that ...
0
votes
0answers
30 views

Setup dual NIC for selective apps to use a VPN

I am relatively new to ubuntu but have learnt a lot while trying to fix my setup. Basically, my problem is that I have a Desktop computer that needs to connect to a VPN service for certain ...
0
votes
1answer
183 views

How can I find and edit multiple lines and replace them using sed on nginx/sites-available/default

I need to uncomment the existing text inside the default file the file in this site is very similar to my default file https://salsa.debian.org/nginx-team/nginx/blob/master/debian/conf/sites-...
9
votes
5answers
2k views

Why is a blank required between “[[” and “-e xxx” in ksh?

For instance, the following command does not work: if [[-e xyz]]; then echo File exists;fi ksh gives the following error [[-e: command not found Is that because "[[-" is ambiguous?
1
vote
1answer
31 views

syntax for creating variable out of command with apostrophe in it [closed]

NOOB level: horrible at syntax and regular expressions and BASH programming in general but learning and studying for the Lin+ I'd like to run this script but it doesn't like my syntax apparently. ...
0
votes
0answers
38 views

Syntax error near unexpected token `{workingDir=$(pwd)' [duplicate]

Here is the problematic line in question. function gradeUpdate() {workingDir=$(pwd); cd $GRADE_DIR; rm -Rf gradingScript/; git clone https://github.com/[redacted]/gradingScript/; cd $workingDir} Of ...
0
votes
1answer
62 views

What happens if no destination is defined after > (redirection)?

recently I wanted to read the man pages for mplayer. So I needed to type man mplayer in the terminal. Yet out of clumsiness I typed man mplayer>. I know that I could redirect the output e.g. to ...
1
vote
2answers
2k views

linux shell script Syntax error: word unexpected (expecting “fi”)

Below I have a shell script i wrote and when I try to execute it I get an error in my terminal describing the "expecting fi" keyword. I have written it down before the done keyword and have still not ...
10
votes
2answers
6k 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
542 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....
-1
votes
1answer
225 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
3answers
503 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
4k 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 ...
1
vote
1answer
804 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/...
8
votes
1answer
2k 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
215 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
3k 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
932 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
654 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 ...
1
vote
0answers
59 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 ...
2
votes
1answer
359 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
2k 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
3answers
23k 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?
-1
votes
1answer
348 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
2answers
1k 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
175 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, ...
3
votes
1answer
3k 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 ...
16
votes
3answers
5k 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
45 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
6k 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
2k 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 ...
2
votes
1answer
4k 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
3answers
1k 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
30 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 ...
7
votes
1answer
3k 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
266 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 ...
11
votes
2answers
4k 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
6k 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
499 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
1k views

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

I'm attempting to make a simply security log-in that prompts the user to input a name and then if said name matches one of the if statements, it proceeds to have them enter a password followed by an ...
0
votes
1answer
35 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
463 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
835 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
1k 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
2k 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 ...