Space in input filename with pipe


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Space in input filename with pipe
# 1  
Old 08-01-2018
Space in input filename with pipe

Hello,
Normally below script works, could you please comment out what could be the reason of failure if there are spaces in input filename:

script.sh
Code:
#!/bin/bash
cd /home/hts/.hts/tvh/
file="$1 $2 $3 $4"
read -d $'\x04' name < "$file"
/usr/bin/ffmpeg -i ""$name"" -vcodec copy -preset superfast -qscale 0 -map 0 -acodec copy -f mpegts -strict -2 pipe:1 < /dev/null

euronews file inside:
When I run this script like this way no problem:
Code:
pipe:///home/hts/.hts/tvh/script.sh euronews

EU: Euro News file inside:
Below command not works:
Code:
pipe:///home/hts/.hts/tvh/script.sh EU: Euro News

It says
Quote:
Line 4 EU: Euro News no such file or directory
Both files are in the same directory, chown is the same for both files and both files have the same stream source.

Maybe I need to take a fresh air for a while

Thanks
Boris

Last edited by baris35; 08-01-2018 at 03:47 PM.. Reason: quote
# 2  
Old 08-01-2018
Code:
/usr/bin/ffmpeg -i ""$name""

The redundant quotes mean the variable's not actually quoted at all. Remove the ones marked in red.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Removing pipe and space in a file

Hi , I have a file which is like below. The file record is separated by | as delimiter. I want to remove the first and last | in the file and also I want to remove the spaces in the columns. Original File |3464114 |10 | REPORT|CA| 1|0|4825400|0|213167| 939396524| Expected:... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

2. Shell Programming and Scripting

While read pipe input issue

Hello, I have an ffmpeg bash script which is working nice and I need to do the same for other sources. To create new scripts and to deal with multiple bash files sounds not logical. It is a bit hard to manage for me.. I wondered if it was possible to make my input file as variable. Then I... (1 Reply)
Discussion started by: baris35
1 Replies

3. Shell Programming and Scripting

How to pipe a filename that includes a date?

How do I pipe the output of something to a filename that includes the date, in a specific date format? Here's the goal. Output a script to a file periodically during the day: ./script.sh >>logname_yyyy-mm-dd.logAnd when the next day comes, it starts logging to a new filename because the date... (2 Replies)
Discussion started by: nbsparks
2 Replies

4. Shell Programming and Scripting

Replace space and tab to pipe delimeter

I have file like below abc 12 34 45 code abcdef 451 1 4 code ghtyggg 4 56 3 code I need to change this to abc|12|34|45|code| abcdef|451|1|4|code| ghtyggg|4|56|3|code| I tried replace space with | in sed ... but in the middle some row has... (7 Replies)
Discussion started by: greenworld123
7 Replies

5. Shell Programming and Scripting

function terminating if i give input as space or no input and enter

HI i have written a script to ask input from the user. this script should promote the user for y/n input. if user enters anyother input then y/n the script promotes him again. this below code is working fine for all the cases. except for space and enter " if i give space and enter it is... (2 Replies)
Discussion started by: BHASKARREDDY006
2 Replies

6. Shell Programming and Scripting

How to use an input pipe ?

Hi all, I would like to use properly an input pipe, like this : cat myFile.txt | myCommand.shI always find this solution : while read line; do ...; donebut I have a great lost of performance ! On a big file, with a simple grep, I can spend 2400 times more time ! oO (from 0,023sec to 1m)... (4 Replies)
Discussion started by: LeNouveau
4 Replies

7. UNIX for Dummies Questions & Answers

grep pipe filename print issue

uname -a SunOS mypc 5.10 Generic_141414-07 sun4v sparc SUNW,SPARC-Enterprise-T2000 uname -a SunOS mypc 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220 find . -name "*.cer" -exec keytool -v -list -printcert -file {} \; | grep -i "Aug 03" Valid from: Mon Jan 29 00:00:00 GMT... (16 Replies)
Discussion started by: shifahim
16 Replies

8. Shell Programming and Scripting

Filename pattern match and appending pipe

Hi, I have a directory with around 100k files and files with varying sizes(10GB files to as low as 5KB). All the files are having pipe dilimited records. I need to append 7 pipes to the end of each record, in each file whose name contains _X3_ and need to append 10 pipes to the end of each... (3 Replies)
Discussion started by: nss280
3 Replies

9. AIX

Removing a filename which has special characters passed from a pipe with xargs

Hi, On AIX 5200-07-00 I have a find command as following to delete files from a certain location that are more than 7 days old. I am being told that I cannot use -exec option to delete files from these directories. Having said that I am more curious to know how this can be done. an sample... (3 Replies)
Discussion started by: jerardfjay
3 Replies

10. UNIX for Dummies Questions & Answers

replacing space with pipe(delimiter)

Hello All, I have a file with thousands of records: eg: |000222|123456987|||||||AARONSON| JOHN P|||PRIMARY |P |000111|567894521|||||||ATHENS| WILLIAM k|||AAAA|L Expected: |000222|123456987|||||||AARONSON| JOHN |P|||PRIMARY |P |000111|567894521|||||||ATHENS| WILLIAM |k|||AAAA|L I... (6 Replies)
Discussion started by: OSD
6 Replies
Login or Register to Ask a Question