Author Topic: Shell in Linux with a space in the operation how to do it?  (Read 2693 times)

0 Members and 1 Guest are viewing this topic.

Offline smokingwheels

  • Newbie
  • Posts: 6
    • View Profile
Shell in Linux with a space in the operation how to do it?
« on: November 21, 2018, 10:22:57 pm »
I have a few programs that generate BASH files at the moment to various things like cp and mv.

I am having trouble when there is a space in the command line eg cp ~Wagnwash/Dog 21-11-18/imagexxxxx1.JPG ~thrashdrive/tmp/
I would like to populate the SHELL command and run it under program control but atm I have to execute copyfiles.sh.
I also make videos out of images using FFMPEG and would like to have that under program control as well.

Atm I Add new images to a folder and will have QB64 generate all the BASH commands and folders to produce a Phone quality mp4 and a HD quality video from new images.

I would like to be able to have QB64 be a Video maker of some description.

I am working on using a base program to modify another program adding new lines, you update the data then use the first program to write the mods to the second program then run the second program.

Note: Its in my usual English this post sorry if you find it hard to follow.

A program I have is to take a 30 FPS Video from a phone and add it into the main video running at 15 FPS eg use every second frame from the 30 FPS video.




FellippeHeitor

  • Guest
Re: Shell in Linux with a space in the operation how to do it?
« Reply #1 on: November 21, 2018, 10:26:18 pm »
I am having trouble when there is a space in the command line eg cp ~Wagnwash/Dog 21-11-18/imagexxxxx1.JPG ~thrashdrive/tmp/

Add CHR$(34) before and after the file name, that should do it.

Offline smokingwheels

  • Newbie
  • Posts: 6
    • View Profile
Re: Shell in Linux with a space in the operation how to do it?
« Reply #2 on: November 21, 2018, 10:33:12 pm »
Ok Thank you I will give it a go.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Shell in Linux with a space in the operation how to do it?
« Reply #3 on: November 22, 2018, 12:29:57 am »
In Windows, it would be:

CHR$(34) + "Wagnwash/Dog 21-11-18/imagexxxxx1.JPG" + CHR$(34)

or just the directory with spaces...

"Wagnwash/" + CHR$(34) + "Dog 21-11-18" + CHR$(34) +"/imagexxxxx1.JPG" + CHR$(34)

Maybe it is the same for Linux.

Pete
« Last Edit: November 22, 2018, 12:47:29 am by Pete »
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/