NOTICE: This site has been archived. All content is read-only and registration is disabled.

A new site is being built and the Basic Action Games Discord server is an active hub for discussion and games.

-Admin

trouble with name increment

Talk about anything, but keep it civil
Post Reply
User avatar
meaulnes
Unknown Quantity
Unknown Quantity
Posts: 2
Joined: Sat Jan 14, 2012 12:00 am

trouble with name increment

Post by meaulnes »

I am trying to write a script that records a window on my screen. No pb with that.
To go further I would like to choose an incremental fileName for output incrementing if the fileName already exist.
I have trouble doing it so before dealing with the incrementation itself I want to check I can substitute the calculated name in the ffmpeg command.

Code: Select all

filename="~/Bureau/essai"

index=1 #I will deal with the incrementation of index after this part works

mystring="${fileName}${index}.mkv" #omce I have a proper index I concatenate the name with index and name extension

echo ${mystring} # gives ~/Bureau/essai1.mkv seems to be what I expect

ffmpeg -f alsa .....  -y ${mystring}  # gives error message ~/Bureau/essai1.mkv: No such file or directory despite -y to force overwriting
However if I put the file name directly in the command like this

Code: Select all

ffmpeg -f alsa .....  -y ~/Bureau/essai1.mkv 
it works perfectly. My question is : "What is wrong ?"
User avatar
capmarvel
Costumed Crimefighter
Costumed Crimefighter
Posts: 165
Joined: Sat May 21, 2011 11:00 pm
Location: Michigan, USA
Contact:

Post by capmarvel »

You do realize this forum is for the BASH role-playing game, and not the BASH Linux shell, right?
User avatar
meaulnes
Unknown Quantity
Unknown Quantity
Posts: 2
Joined: Sat Jan 14, 2012 12:00 am

Post by meaulnes »

No I didn't. I am sorry. I didn't even know that it exist.
User avatar
capmarvel
Costumed Crimefighter
Costumed Crimefighter
Posts: 165
Joined: Sat May 21, 2011 11:00 pm
Location: Michigan, USA
Contact:

Post by capmarvel »

Well it does, and its a great game!

PS- if you purchase a copy I'll help you finish your program :lol:
User avatar
BASHMAN
All-Father of Bash!
All-Father of Bash!
Posts: 2585
Joined: Sat Apr 03, 2010 11:00 pm

Post by BASHMAN »

capmarvel wrote:Well it does, and its a great game!

PS- if you purchase a copy I'll help you finish your program :lol:


:lol:
Post Reply