79 votes
Accepted

What does this syntax mean?

$ type echo echo is a shell builtin meaning, the echo command is part of the bash program itself (assuming you use bash) -n is an option, so let's see what it does $ help echo Write arguments to ...
Zanna's user avatar
  • 70.5k
31 votes
Accepted

Run another command when previous command completes

&& means to run it if the previous command was successful. In Unix that generally means exit status 0. $ ls barfoofba && echo "This will not be echo'd" ls: cannot access 'barfoofba': ...
vidarlo's user avatar
  • 22.7k
25 votes
Accepted

For loop with Alphabet

Presumably, you are running the script as: sh ForLoopAlphabetTest.sh In Ubuntu, sh is symlinked to dash; as dash has no concept of arrays, you are getting the syntax error for (. The script works ...
heemayl's user avatar
  • 91.8k
15 votes
Accepted

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

The simplest explanation would be, because in the manual it appears as [[ expression ]] so there has to be space between [[ and expression and closing ]]. But of course we can attempt to look at it ...
Sergiy Kolodyazhnyy's user avatar
14 votes
Accepted

What does the syntax of pipe and ending dash mean?

The pipe command (|) means take the output of the command on the left and pass it in as input to the command on the right. So, you are almost correct in your understanding of what curl -sL https://...
Lewis M's user avatar
  • 755
13 votes
Accepted

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

The <(openssl dgst -sha256 filename) construct is a process substitution. It creates a file (or FIFO) behind the scenes and passes its name back to the command sequence. < is a regular ...
steeldriver's user avatar
12 votes

Run another command when previous command completes

The command ls -lR exited with an exit-status different than zero, so the following commands have not been executed. Most probably ls was unable to open a subdirectory. It didn't happen in your first ...
mook765's user avatar
  • 16k
11 votes

What does this syntax mean?

You should start with manual pages, the command man. Just type man <command> to get information about a <command>. Navigating in man is not very intuitive but there are lots of guides to ...
Melebius's user avatar
  • 11.4k
10 votes

For loop with Alphabet

Your script uses three features of the Bash shell that are not provided by all Bourne-style shells. As heemayl says, you can simply run that script with bash instead of sh. Your hashbang line at the ...
Eliah Kagan's user avatar
10 votes

Can I enable bracket matching in nano?

set brackets ""')>]}" set matchbrackets "(<[{)>]}" Update ~/.nanorc (or perhaps /etc/nanorc) with these lines and it works like a charm. When on any bracket press Meta] (often this will be ...
owsmmj's user avatar
  • 301
10 votes
Accepted

syntax error: unexpected end of file .bash_profile

There needs to be a semicolon or line break before the fi: if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
Florian Diesch's user avatar
9 votes

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

The <( COMMAND ) Bash construct is called process substitution. It evaluates the COMMAND inside and redirects its output to a FIFO, a named pipe that gets a virtual file descriptor inside /dev/fd ...
Byte Commander's user avatar
  • 108k
9 votes
Accepted

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

I found youtube-dl to be outdated, so I found a solution at: https://www.linuxbabe.com/desktop-linux/install-youtube-dl-linux-use I installed: pip3 install yt-dlp It works OK: yt-dlp https://www....
xerostomus's user avatar
  • 1,000
7 votes
Accepted

what does the -aux option of ps stand for?

From man ps, the manual page of the ps command (excerpts only): a Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes when some BSD-style (...
Byte Commander's user avatar
  • 108k
7 votes

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

This can happen if your files have a non-printing byte sequence at the start - for example a byte order mark - perhaps as a result of having edited them in a word processor program or Windows text ...
steeldriver's user avatar
6 votes

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

Way back, in Unix V6 and Thompson Shell, the : was actually used as part of the goto statement. According to the manual, it originally appeared in version 3 of Unix: The entire command file is ...
Sergiy Kolodyazhnyy's user avatar
6 votes

-bash: syntax error near unexpected token `&'

I think what you are trying to do is run these commands: sudo chown -hRf webadmin:www-data /web/repertoire && sudo ln -s /web/repertoire /var/www/html/repertoire && sudo chown -hRf ...
terdon's user avatar
  • 101k
6 votes

How do I send GET and POST requests using Curl?

Seems like you following a tutorial or book and this is a cheeky way to test if you got the basics down. Calling http://103.200.7.150:7777/ via curl or browser yields the following output: ...
Videonauth's user avatar
  • 33.4k
6 votes
Accepted

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

Answer is simple: You got syntax error, output is not redirected without destination
LeonidMew's user avatar
  • 2,734
5 votes
Accepted

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

Both ansible and python-certbot-apache are available from the official sources and you only need step 3 to install them. The PPAs have newer versions of the software though, so I assume you want to ...
dessert's user avatar
  • 40k
4 votes

What does this syntax mean?

echo -n "Today's date is: " It will print: Today's date is: date +"%A, %B %-d, %Y" It will print something like this : Tuesday, February 7, 2017 Advice : use man or --help command to know more ...
Avinash's user avatar
  • 233
4 votes

How to install Maxima and make syntax on Ubuntu Server 18.04

Maxima is a version of the MIT-developed MACSYMA system, modified to run under Common Lisp. It is an interactive expert system and programming environment for symbolic and numerical mathematical ...
karel's user avatar
  • 115k
4 votes
Accepted

Add a tag to jpeg using ExifTool

Try adding your notes to the Description tag. Your command would look like this: exiftool -Description='Some notes' file.jpg This command creates backup files. Add -overwrite_original to suppress ...
StarGeek's user avatar
  • 483
3 votes
Accepted

"pip install pyarrow" returns syntax error

You are adding that at the wrong location. On the python command line you use pyarrow by doing this: >>> import sys >>> import pyarrow If you get ... Traceback (most recent call ...
Rinzwind's user avatar
  • 300k
3 votes

line 56 syntax error: unexpected end of file

You can run your script through shell checker: $ shellcheck myscript Line 7: CIVIS(){ $e "\e[25l"} ^-- SC1009: The mentioned parser error was in this function. ^-- SC1073: Couldn't parse this ...
WinEunuuchs2Unix's user avatar
3 votes

How do I send GET and POST requests using Curl?

I answer here because I don't have enough rep to comment. There are two answers and the most voted answer does not know the workings of the HTTP protocol. POST data travels in the body of the HTTP ...
Braulio J. Solano's user avatar
3 votes

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

You can use it on the positive test of an if command when you only want to do something on the negative side. For example: if [[ True == False ]]; then : else echo "true <> flase" fi ...
WinEunuuchs2Unix's user avatar
3 votes
Accepted

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

“Expecting fi” means your script is missing this keyword. In your case you have two ifs, but only one fi, leaving the first unclosed. Correct it to: else echo $(( VAL1 / VAL2 )) ...
dessert's user avatar
  • 40k
3 votes

syntax for creating variable out of command with apostrophe in it

You seem to have an unnecessary ' character in front of your route command. This leads to an unterminated quoted string error message as you have an odd number of apostrophes. Change gateway=$('...
Arronical's user avatar
  • 19.9k

Only top scored, non community-wiki answers of a minimum length are eligible