Getting the error message -bash: syntax error near unexpected token `)' - terminal

I am trying to enter the command to open a specific file on my desktop. The file has one closing parentheses in it, after a 0. How do I get around this? I will attach a screenshot of the Terminal.
Screenshot of Terminal

Try putting the filename in double quotes like open "/foo/bar (0).pdf"

Related

In VS codes terminal how to display the directory showing line on the new line and not on the last line of output?

In vs code's terminal the line which shows the directory(the line which takes input when opened fresh) is being displayed on the last line of output. Normally the directory should be displayed on the next line after the output. In my vs code the last output line itself shows the directory line and waits for input.. Is there any way to change this weird terminal behavior? Thanks in advance.. I am new to command line and lack proper terminologies.. sorry.. please ask if something feels unclear..

'export' command not found on new terminal window

Upon opening a new terminal I will get
-bash: ‘export: command not found
This line will only appear once then my base cmd line reappears.
I have read the other stackoverflow answers that seem similar but for some reason they get the error
-bash: ‘export: command not found
multiple times consecutively rather than just once.
I want to understand why this is appearing and if so what are likely causes. I am currently working on creating a website and had installed some of the requisite things like ruby but I do not know what specifically would have caused this.
The error message shows a U+2018 character ("LEFT SINGLE QUOTATION MARK"), i.e. a "smart quote".
This is likely coming from a .bashrc or .profile that's executed on Bash startup. Look for it next to an utterance of export.
Since it's not a script character (like a normal quote ') Bash is considering it to be part of the command name, and there is indeed no such command as ‘export.

Bash returns "syntax error near unexpected token `('"

I am programming using IDL and unfortunately I decided to name a file using "(" and now I want to remove this file using "rm" but every time I try I get this same error message. It seems that I cannot copy or delete or doing anything with the file.
Use double quotes
For eg. rm -rf "abc(meow)pqr"
Use ? in place of ( when describing the file name.
rm -i ff?.txt
When asked rm: remove regular file 'ff(.txt'?, answer y.

Ambiguous redirect error while using rtmpdump

So I was trying to download somevideos using rtmpdump, and I used this shell script which is supposed to download the some videos but it gave me and error message saying
./script: line 9: $1: ambiguous redirect
Now I am pretty sure that I am doing something silly so I will tell you exactly what I did. I first downloaded that above file into my system saved it as "script". And opened terminal and typed:
./script
and it gave me the above error.
Now I have also gone through this thread, and also some other threads but they don't seem help me at all and now I have nowhere to go. please save me.
script tries to use $1 as the name of a file for redirection (e.g., someCommand > "$1"), but you didn't supply a an argument when you called script.
The script needs a file as the first parameter which will have one video to download per line

syntax error near unexpected token `>' when using '&>>' redirection operator

At the beggining of my file I redirect stderr to stdout, and stdout to logfile, quick and lazy way to log everything printed.
During my script, some commands have large/unused output and I want to redirect them to my logfile without their output showing on stdout.
I tried to use /etc/init.d/myservice stop &>> file.log, but always ending up with the error "... syntax error near unexpected token `>'"
Bash version is 3.2.25(1)-release
That syntax wasn't introduced until bash 4. You can do the same thing though with
/etc/init.d/myservice stop >> file.log 2>&1
as noted here

Resources