Linked Questions

-1
votes
1answer
79 views

Using “” in shellscript

i need to use a ffmpeg command in a shellscript The command is the next one (ffmpeg -hide_banner -hwaccel cuvid -c:v h264_cuvid -f hls -i $(youtube-dl -f 95 -g $ylink) -c:v h264_nvenc -r 50 -c:a ...
3
votes
1answer
87 views

Trying to create a folder with date and time with a space

I am trying to create the folder using: mkdir $(date +%Y-%m-%d %H%M) So you see a space between the two and I know this is not best practice but I would like to get it to work. I have tried to ...
3
votes
1answer
94 views

How to send JSON as variable with bash curl?

I'm trying to send a POST request with curl, but I'd like to store the json data in a variable in order to resend it if an error occur. I used this code: jsonvariable="{"ora" : "value1", "temp" : "...
-1
votes
1answer
53 views

How to edit a file that has a space in its name? [duplicate]

I'm on Ubuntu 18.04. If I go into my home directory and right-click and select "new document" and then "empty document", a new file appears called "Untitled Document". Now I want to edit what's in ...
1
vote
1answer
65 views

Can you quote a random string without knowing if it contains special characters?

I'm having trouble inputting random generated passwords into some scripts. I generate the password, and paste it between "". But sometimes it contains characters that sends the whole thing crashing ...
2
votes
2answers
133 views

single quote and double quotes in sed

I tested the single quote and double quotes in sed me@host:~: $ echo "front" | sed "s/front/back/" back me@host:~: $ echo "front" | sed 's/front/back/' back They performed identically, but I ...
19
votes
9answers
3k views

Open a doc from terminal, but not by its name

Is it possible to open a file from the terminal not by its name but by its (number) position in the folder? Or any other option? Because the name is too long.
0
votes
1answer
74 views

File's order got destroyed while grepping and echoing into for loop

I want to write the result of grep inside for loop into a file, keeping original file structure. Original file: $cat newtest1 some_text /homes/myself/joz ivan petrov - 20/10/19 new customer: /homes/...
0
votes
0answers
16 views

Cannot compile a c++ file on Ubuntu if the filename containes brackets [duplicate]

I ran into this weird error /bin/bash: -c: line 0: syntax error near unexpected token `(' /bin/bash: -c: line 0: `g++ -g 54.Array(300A).cpp -o 54.Array(300A)' The program compiles if I change the ...
3
votes
2answers
149 views

How to run commands in the shell in parallel without disrupting the output?

I have the following shell script: ./run 50 5000 100 100 1.0 2 0.3 0.3 0.05 1 101 0 2 1 0 10 0.1 & ./run 50 5000 100 100 1.0 2 0.3 0.3 0.05 1 101 0 2 1 0 10 0.2 & ./run 50 5000 100 100 1.0 2 ...
2
votes
2answers
100 views

Using SED to delete text in a file

I am trying to create a bash script that will manage a basic inventory system for a friend. Everything he wants to inventory has a barcode, that when scanned, returns a 6 digit number (EX. 000001). I ...
5
votes
2answers
361 views

Dealing with space in file links using bash [duplicate]

I got a problem. Here is my bash script to merge videos with subs: #!/bin/bash cd /media/ptrknvk/'TOSHIBA EXT'/Shows/My/'Doctor Who'/ url0='DW s11e0' url1='DW\ s11e' for(( i=1; i<11; i++ )) do ...
3
votes
3answers
643 views

Replace String “Development” with “Staging” or “Production” using SED

I am trying to replace the string : 'development' with : 'production' using sed. I tried a few options including: sed -i "s|: \'development\'|: \'staging\'|g" index.php but without any luck. ...
2
votes
2answers
165 views

How to send output of convert to a writable directory in bash?

I want to convert .tbl files to .csv in /data/ directory which I've got read-only access. I'm using this command: for i in `ls *.tbl`; do sed 's/|$//' $i > ${i/tbl/csv} echo $i done But I'...
1
vote
1answer
80 views

auto edit a text file

first let me say I have been teaching myself Linux, and I am not "techie" knowledgeable yet. I am using Ubuntu 18.04 and find myself using the BASH to create files I can run. One thing I am trying ...

15 30 50 per page