I'm new to working with pipes, so I don't know whether the following is expected behaviour or a bug on the part of an application.
Since Version 0.47, Inkscape provides a non-GUI interactive shell mode of operation. I am trying to time the program's performance in converting SVG files to PNG images and compare this to other apps. Inkscape expects a line of optional arguments and a file name to be delivered to its command prompt. (see the bottom part of Chapter 24. Using the Command Line for an example how it works) I am using a named pipe for delivering these lines. My benchmarking scripts are these:
svgbench.sh
inkscape-shell.sh
As you can see, the pipe Inkscape gets its commands from is accessed consecutively from different processes (one for every test loop, and the 'quit' command), and there are times when the pipe in.fifo is not connected to any file descriptor. Whenever this happens, Inkscape quits, even if no explicit quit command is given.
I have tracked this behaviour back to this: man pipe(7) states "If all file descriptors referring to the write end of a pipe have been closed, then an attempt to read from the pipe will see end-of-file (read will return 0)." Looking closely at the accordant source code of Inkscape, I think what happens is that
stdin is read continuously in a loop
fgets() in line 01059 means that an EOF will cause the loop and consequently the programm to quit.
Now my question: is this the expected behaviour of an interactive shell program, or should it be perceived as a bug?
And if it is to be expected, how could I achieve a timed execution of inkscape-shell.sh without forking to a new process? Are there other ways to feed lines to an interactive shell?
Hi guys,
I've create 3 shells concerning my work, which named as 1.sh, 2.sh and 3.sh.
However, how can I make an interactive query for these shells just like the old (fdisk) in windows9x. I want to make an interface tells the user just like this:
Press 1 to execute "1.sh"
Press 2 to... (5 Replies)
Hello experts,
I have a to write script for monitoring, the script would use a command and I plan to write the script as follows
while true
do
command -arg
sleep 2
clear
done
The output would be set up on a screen for monitoring. However the issue is that the command used in... (2 Replies)
Hi Guys,
Excuse if am asking silly Que ... :rolleyes:
Please explain me whats difference between login and interactive shell in Linux .. Have googled but still in doubt .. :confused:
--Shirish Shukla (4 Replies)
Hi,
I have a script that calles some other scripts. Those scripts are expecting some inputs.
Right no I am typing manually. But now the number of questions from other scripts are too much and I want to give asnwers autimatically.
example.
Other scripts gives me 2 options
1) joom... (2 Replies)
Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files... (8 Replies)
Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files... (1 Reply)
Hi,
like if i want to authenticate and i 100% know the password and username
i can run a script with
su - username
and then feed in the password through file pass.txt
script.sh < pass.txt
but if i don't know in which order the script is going to prompt for the input is there a way i... (4 Replies)
Hi,
I need to schedule a shell script which executes another shell script along with a series of other commands.
When the inner shell script is executed it prompts for a password.....
This inner shell cannot be changed
How can I do this????
Regards,
Chaitrali. (4 Replies)
Hi,
How can I prompt a user for two input and pass the input to variables in the script. I have the following script but it is not working:
+++++++++Begin+++++++++++
#!/bin/sh
database_c=$1
output_f=$2
echo "Your db is $1\nOutput is $2"
+++++++++End+++++++++++
Thanks,
Leonard (3 Replies)
hello all,
i hv attached herewith my program to implement a simple interactive shell in C. no matter hw hard I try, I keep getting some errors. i need help - urgently !!
proj1test7.c: In function `parseCommand':
proj1test7.c:102: warning: assignment makes pointer from integer without a cast... (2 Replies)