Pipe, permission denied error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pipe, permission denied error
# 1  
Old 08-05-2018
Pipe, permission denied error

Hello,
I am trying to stream lines written into file. When first source is down, I expect the code to swap to second line and run it.

Script below works as usual and it prints out each line of the input file (s.txt):
Code:
#!/bin/bash
while read -r line;
do
echo "$line"
done <"$1"
exit 0

Output is:
Code:
http://xx.yy.zz/1.m3u8
http://xx.yy.zz/2.m3u8
http://xx.yy.zz/3.m3u8

That is okay....But when I replace echo command by ffmpeg command, it gives permission denied error

removed line:
Code:
echo "$line"

added line:
Code:
/usr/bin/ffmpeg -re -y -i $line -vcodec copy -acodec copy -strict -2 -f mpegts  pipe:1 < /dev/null

final status (final.sh):
Code:
#!/bin/bash
while read -r line;
do
/usr/bin/ffmpeg -re -y -i $line -vcodec copy -acodec copy -strict -2 -f mpegts  pipe:1 < /dev/null
done <"$1"
exit 0

My input file s.txt:
Code:
http://xx.yy.zz/1.m3u8
http://xx.yy.zz/2.m3u8
http://xx.yy.zz/3.m3u8

I run the code like this way:
Code:
pipe:///var/bin/final.sh s.txt

output:
Code:
2018-08-05 20:01:10.209 spawn: /var/bin/final.sh: line 5: s.txt: Permission denied

script has been chmod 755, chown is set to root for all files.
I'd appreciate if you could lead me what I did wrong.


Kind regards
Boris

Last edited by RudiC; 08-05-2018 at 04:21 PM.. Reason: Changed / inserted some ICODE tags
# 2  
Old 08-05-2018
What be the permissions of s.txt?
# 3  
Old 08-05-2018
Hello Rudic,
It's 644
Strange thing is that when I run it like this, it gives permission error:

Code:
pipe:///var/bin/final.sh http://xx.yy.zz/1.m3u8

This one also gives the same error:
Code:
pipe:///var/bin/final.sh "http://xx.yy.zz/1.m3u8"

Shoud I add IFS command into script?


Kind regards
Boris
# 4  
Old 08-05-2018
Replace [CODE]echo "$file"[/CODE] with [CODE]cat "$file"[/CODE] and rerun...
nonsense...
What do you mean by
Quote:
I run the code like this way:


Code:
pipe:///var/bin/final.sh s.txt

Is that in a browser?

Last edited by RudiC; 08-05-2018 at 04:34 PM..
# 5  
Old 08-05-2018
Here you are Rudic:

Code:
cat: http://xx.yy.zz/1.m3u8 No such file or directory
cat: http://xx.yy.zz/2.m3u8 No such file or directory
cat: http://xx.yy.zz/3.m3u8 No such file or directory

# 6  
Old 08-05-2018
Sorry, wrong idea...





What do you mean by
Quote:
I run the code like this way:


Code:
pipe:///var/bin/final.sh s.txt

Is that in a browser?
# 7  
Old 08-05-2018
Yes Rudic, web application
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Permission denied error using chmod on a cifs mount

I have a RHEL 5.7 system with a cifs mount from a Windows 2007 file server that I need to fix the permissions on. Once the share is mounted the permission for the mount are 777. I need to change that to 770 on the top level directory and to 640 on the sub-directory .ssh/. But when I run chmod... (0 Replies)
Discussion started by: westmoreland
0 Replies

2. UNIX for Dummies Questions & Answers

Webserver permission denied error

Hello, I was trying a perl-cgi tutorial and saving the data from online form to a file named (guests.txt). I am using the localhost port 80 for practice. My page file "guestbook.html" is working as I saw the online form. After filled out the blanks and submit, I was expecting to see the result... (3 Replies)
Discussion started by: yifangt
3 Replies

3. UNIX for Dummies Questions & Answers

Getting Error 0403-006 Execute permission denied.

Hi All, Need your help.. I am writing one script in which I am assigning value to one variable but when i am executing it is showing error "0403-006 Execute permission denied" below is the line of that script : INPUT_COUNT=wc $GIF_DIR/input/VID_RIMS.DAT | awk '{print $1}' and access... (2 Replies)
Discussion started by: NirajThakar
2 Replies

4. Shell Programming and Scripting

Change: xecho: execute permission denied error

Hello, I am have an issues with one of my scripts. I get the following error when I get to the point in the script where I am making the change. The change does take however. the error is "change: xecho: execute permission denied" Everything was working properly until I start cleaning... (3 Replies)
Discussion started by: simpsonjr
3 Replies

5. OS X (Apple)

Permission Denied Error with X11

Hello, I am using Tiger 10.4.11 I am trying out the GIMP, so I installed the X11 package from "Optional Installs" on the cd. Whenever I open X11, I get an error: xterm: could not exec /dev/null: Permission denied I have chmodded /dev/null to 777, as well as the /tmp directory. I deleted... (2 Replies)
Discussion started by: Ricardo-san
2 Replies

6. Shell Programming and Scripting

ERROR : Permission denied (publickey,password,keyboard-interactive).

Hello, when I try to connect to a remote machine through SSH username@host I am getting the error message Permission denied (publickey,password,keyboard-interactive). Can any one tell me what is the problem. the key is added in the remote machines authorized_keys file. (5 Replies)
Discussion started by: deepusunil
5 Replies

7. UNIX for Advanced & Expert Users

Need help with Couldn't canonicalise: Permission denied error

Hi People I am getting this error Couldn't canonicalise: Permission denied. Anyone knows what does this error mean ? It all started when my team members were testing Sftp functions on some directories and they were hitting directory no found errors within their scripts. So when we enquired... (8 Replies)
Discussion started by: wilsontan
8 Replies

8. Shell Programming and Scripting

xterm gives me permission denied error

When I try to run xterm at a command prompt in solaris 2.5.1, i'm getting a permission denied error. But the directory and user permissions look ok, they are part of a users group and then also root,sys,adm so what gives? Any ideas? Thanks! (1 Reply)
Discussion started by: kymberm
1 Replies

9. UNIX for Advanced & Expert Users

getcwd: permission denied error

When I do a 'cd /appl' and issue 'ls -al' command, I get the following error for .. directory. ./..: Permission denied But still I get a listing of other directories under /appl. Also, if I give 'man' for any command under this /appl folder, I get the following error: ... (3 Replies)
Discussion started by: Deepa
3 Replies

10. UNIX for Dummies Questions & Answers

rm Permission Denied error

I am very new to Unix. We have a script that will remove files from a directory. The account removing the files has the same permissions as the directory the files are located. We have logged in as the account and deleted the files from that directory but when we run the script with the account... (7 Replies)
Discussion started by: Cech2002
7 Replies
Login or Register to Ask a Question