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
0 votes
1 answer
39 views

Is there a good apt syntax for installing an approximate package version?

Sometimes I don't immediately know the full package version details, but I do know which major.minor version I'm after- For example, say I have package foo-package with several versions of debs ...
ti7's user avatar
  • 139
2 votes
3 answers
9k views

how do I fix youtube-dl: running it gives error message about incorrect syntax

I recently installed 22.04 completely from scratch. Just now I followed instructions to install youtube-dl, with wget (from github.com): sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/...
Akpglt's user avatar
  • 23
0 votes
1 answer
412 views

Can not update GRUB due to syntax error /out of memory error

I have a dual boot with Windows 11 and Ubuntu 22.04 and I'm not able to update GRUB due to the following error Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' ...
Vincenzo's user avatar
0 votes
0 answers
128 views

not a valid identifier while exporting path

I have two Cuda installations namely 11.8 and 12, and would like to switch between them without manually editing the .bashrc file and sourcing it again. For that I have come up with the following ...
Atharva Dubey's user avatar
0 votes
1 answer
168 views

Syntax error when creating directory with spaces, parentheses, apostrophe, and question mark [duplicate]

I know that this probably has something to do with escaping characters, and that there might be similar questions asked already, but this is a tricky combination that I can't figure out. On my Plex ...
Saar Koren's user avatar
-1 votes
1 answer
476 views

Syntax errors ubuntu 22.04

every time i update my system using the sudo apt update command in the terminal i notice this at the bottom. sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" ...
Steven Mwamba's user avatar
1 vote
1 answer
80 views

problem bashrc file colored terminal

I have a problem with my terminal in Ubuntu server 20.04. I would like to color the syntax in my terminal, but after I restart the server, it's back to the normal uncolored syntax. I edited .bashrc ...
Dany's user avatar
  • 81
-1 votes
1 answer
20 views

why head -5 /filepath and head -n 5 /filepath shows the same output?

I'm sorry for this silly question but i'm new to terminals and i don't quite understand how we can pass a number of lines without an option. Even the man page says: -n, --lines=[-]NUM ...
Ahmed Amine Amouchi's user avatar
0 votes
0 answers
864 views

Syntax error: "}" unexpected (expecting "then")

I was sent a file to run to help setup my environment to work on my companies network but after making it executable I keep running into this error regarding a curly brace and it wanting then, I have ...
Daredevilspaz's user avatar
0 votes
1 answer
2k views

syntax error near unexpected token '(' when initializing main [closed]

So I keep getting an error: syntax error near unexpected token '(' and it's referring to the line 'int main(){' in my code. I don't know why I'm getting this error, can someone please help?
Anna M's user avatar
  • 11
-3 votes
2 answers
877 views

syntax error near unexpected token [closed]

I was writing a bash script where I faced the below error and I have no idea about the reason: syntax error near unexpected token `fi' my script: #!/bin/bash if [ 5 -gt 1 ]; than echo "Hello ...
Ahmed Abbady's user avatar
0 votes
1 answer
2k views

Using chown to change ownership on additional HDD

OS Linux 20.04. Having installed an additional HDD in position /dev/sdc1 (Label Data 22) I am confronted with root as owner. Is either of the following syntaxes correct in order to set me up as owner? ...
Pears9's user avatar
  • 1
2 votes
1 answer
1k views

Add a tag to jpeg using ExifTool

I would like help with terminal syntax code please to add a tag to jpeg files using ExifTool. I want to add general notes to some old scanned jpeg pictures of my ancestors for my kids to be able to ...
Marty's user avatar
  • 87
-1 votes
2 answers
767 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 ...
Amber1993's user avatar
0 votes
3 answers
156 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.
Thomas JJ's user avatar
6 votes
2 answers
1k 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 ~/....
Sami's user avatar
  • 71
0 votes
1 answer
2k 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 ...
sumer fattoum's user avatar
0 votes
1 answer
53 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 ...
Bento's user avatar
  • 149
1 vote
2 answers
672 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 ...
Artur Meinild's user avatar
2 votes
2 answers
2k 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 ...
CJ-Tech's user avatar
  • 35
0 votes
1 answer
513 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 ...
Tigerz's user avatar
  • 1
0 votes
1 answer
170 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/...
Archisman Panigrahi's user avatar
5 votes
3 answers
6k 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 ...
Hedley Finger's user avatar
0 votes
2 answers
717 views

When making an alias can quotation marks, apostrophes or semicolons prevent the command from working properly?

I have a file called .bash_aliases where I keep my aliases. While I have just one alias in the file it works properly, however when I try to create a new one the terminal fails to recognize the ...
trayingHardFi's user avatar
-1 votes
1 answer
642 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 ...
Fred007's user avatar
  • 141
0 votes
0 answers
144 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 ...
Pseudomax's user avatar
0 votes
1 answer
697 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-...
Shahar Alaluf's user avatar
9 votes
5 answers
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?
AcBap's user avatar
  • 93
1 vote
1 answer
216 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. ...
thursDave's user avatar
  • 105
0 votes
0 answers
43 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 ...
Gigi Bayte 2's user avatar
0 votes
1 answer
106 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 ...
Rosika's user avatar
  • 575
1 vote
2 answers
7k 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 ...
Roosevelt Mendieta's user avatar
15 votes
2 answers
19k 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 ...
Abhishek Kamal's user avatar
2 votes
1 answer
1k 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....
Johan Kun Riyanto's user avatar
-1 votes
1 answer
342 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 ...
Niranjan's user avatar
  • 239
1 vote
3 answers
899 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 ...
Hedley Finger's user avatar
2 votes
1 answer
8k 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 ...
user avatar
1 vote
1 answer
2k 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/...
Vikram's user avatar
  • 11
10 votes
1 answer
9k 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'...
Konrad Viltersten's user avatar
1 vote
0 answers
507 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....
redheadtri's user avatar
-5 votes
1 answer
4k 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 ? ...
nafiseh sadat's user avatar
0 votes
1 answer
2k 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 ...
Alberto Navarro's user avatar
0 votes
0 answers
998 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 ...
CodeCraft's user avatar
1 vote
1 answer
164 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 ...
user unknown's user avatar
  • 6,447
2 votes
1 answer
1k 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. ...
Sergiy Kolodyazhnyy's user avatar
-2 votes
2 answers
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';...
Niall Magner's user avatar
4 votes
3 answers
57k 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?
raka widiana's user avatar
-1 votes
1 answer
453 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:...
OccultusOpus's user avatar
0 votes
2 answers
2k 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 ...
Adam Jones's user avatar
0 votes
0 answers
332 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, ...
Thufir's user avatar
  • 4,451