People who code: we want your input. Take the Survey

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
101 views

The mentioned syntax error was in this while loop [closed]

I ran the below code through shellcheck myscript and keep getting this error. How can I correct it? ****Line 48: while [ $count - lt 3 ] ^-- SC1009: The mentioned syntax error was in this while ...
0
votes
3answers
77 views

Why does the following zsh command change my output? [closed]

When I execute this command port=3128 echo $port:localhost I get 3128ocalhost as output. PS: When I change the first 'l' char it works fine. I can't even google it.
6
votes
2answers
507 views

syntax error: unexpected end of file .bash_profile

I added the below code to empty ~/.bash_profile file and after restarting and login via ssh to the server I get syntax error: unexpected end of file .bash_profile NODE_ENV=production if [ -f ~/....
1
vote
1answer
439 views

ipython shows invalid syntax when running from terminal

I use python 3.7 but also 3.6 and 2.7 are installed, I am using Ubuntu 16.04 LTS. I changed the order of python to python 2.7 still not working, I am using it on VMware. I guess I made changes to ...
0
votes
1answer
17 views

Incomprehensible output using passwd distractedly

With little attention, after doing operations as root on an ext HDD, instead of using the correct command to disable root, I used this syntax sudo -l passwd I got this output /usr/bin/passwd I know ...
0
votes
2answers
149 views

Shellcheck recommendation to double-quote variable does not work when piping to cut

I'm making a script to print ZFS filesystem info - currently in the testing phase, and I'm getting a strange error. The relevant bit of my initial script is this: zfs_human="$(zfs list | head -n ...
0
votes
0answers
983 views

-bash: syntax error near unexpected token `('

I'm getting the above error when copying a file to a hard drive or when downloading to local drive $ scp /var/backup/photos/uk-japan (2012) /local/dir bash: syntax error near unexpected token `('
2
votes
2answers
449 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
139 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
91 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
265 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
2k 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
142 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
40 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
363 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
53 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
39 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
82 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
3k 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
9k 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
796 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
235 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
704 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
5k 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
1k 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/...
9
votes
1answer
4k 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
319 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
1k 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
726 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
1answer
100 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
530 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';...
3
votes
3answers
35k 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
378 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
218 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
46 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
8k 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
31 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
4k 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
273 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 ...
12
votes
2answers
5k 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
8k 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&...