Running this script, bash ./cleanup.bash, Gives the error: cleanup.bash: line 10: syntax error near unexpected token ‘(‘ cleanup.bash: line 10: ‘rm -rf !(composer.json|.git)’ But if I run in in the terminal directly, there aren’t any problems: I tried stripping out all other lines, but I still get the error. How do I enter this correctly in the Bash script? I’m
Tag: terminal
Linux cat and less output for my text file is different from gedit and other gnome editor
I redirected ri’s ruby Array doc into a file but it didn’t look good in gedit. But text looks just fine in cli. That’s how my file looks in terminal editors. Everything is fine here. But when I open it in gedit or other gnome editors, that’s how it looks like. Some specific words look in absurd format. Any suggestions
Running for loop terminal commands in Jupyter
I know how to run command line in Jupyter : using ! For example, run an image file 2.jpg on Python process.py Question is, how to process all files of a folder in iteration way (idx) in Jupyter cell, something like this: Thanks PS: I tried path , did not work: Answer A possible hackish solution could be to use
How to run an installed python package from terminal
I have a python code like so The run.py has a function like so: After installing this package how do I execute the run.py script on my terminal. I realize this question has been asked before but I wasn’t satisfied with that answer as it did not offer me any insight. Answer You want This relies on PYTHONPATH being set
list files that start with two dots and change file names in bulk
I’ve got file that start with two dots located in different directories. I need to list them all and change their names in bulk and remove the dots completely. Any suggestions how to do that? Answer Not very efficient, due to the sh invocation for each file, but this should work, and is safe: How it works: Find files starting
Getting the User ID from the last line of the /etc/passwd file in Linux
I’ve been trying the following: and These statements aren’t working, I’m not sure how to join both of them to get the result I want. It just takes the current command that is in front of the /etc/passwd directory. I’m fairly new to Linux and combining commands together. Thank you for the help in advance. Answer Try: Or: Notes The
Error When trying to push ssh keys into github from bash script
I am working on a script that creates ssh keys and puts them into github using bash. I am running into this error when running this function.. I want a way to generate ssh keys and put them into github from terminal within my script. Error: { “message”: “Bad credentials”, “documentation_url”: “https://developer.github.com/v3” } Answer You are putting too many quotes
Combining ionice and nice in Linux, and transitive priorities
I want to load use both ionice (I/O priority) and nice (process priority) to start-up a program. I see variations of this line all over the internet: (or) Everyone lists it without any elaboration. My question is… how does ionice (the first program) setting the priorities of nice (the second program), affect the third program (the program I want to
Overwriting TS Stream File with FFMPEG in Linux
I’m trying to convert rtmp streams to m3u8 stream. To reach that aim I use FFMPEG. Now, there is no problem with converting and downloading. However, it writes lots of .ts file such as channel0000.ts,channel0001.ts,channel0002.ts. Per every 10 seconds, 1 ts file is created. In this point, I want a single ts file. In other words, I need overwriting because
How to auto answer linux terminal
My code is But after question is “do you want install [y/n]”. How can I automaticaly answer to question? I want Whenever the terminal asks a question, my answer is be “y”. Answer Just add following to your command: It makes sure that confirmation is avoided.