I'm trying to write a script the simplifies the execution of a program:
After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options:
Do you need SMP version? (y/n) [no]
Do you need DMP version? (y/n) [no]
Do you need debug version? (y/n) [no]
Force re-compilation of source files in run directory? (y/n) [no]
If I don't use the script, I simply hit the enter key four times (because the default setting is correct). After that, I am prompted once more:
Select the compiler to compile MFIX? [1]
This time I'd actually like to change the value to 11 (because the default setting is incorrect), followed by a return.
My poor attempt can be seen below:
I have no idea how to script "returns," or if it's even possible given that the script probably doesn't want to continue until the first line has been fully executed.
Any ideas guys? Any recommendations would be greatly appreciated!
suppose i have a bash script:
#!/bin/bash
echo "hello"
echo "how are you"
echo "today"
how can i put the entire script above into a basic c program?
i do not want to translate the bash code to a c code. i want C to run the bash code. is this possible?
i found this on the... (15 Replies)
Hi all,
I am trying write a shell script to automate the installation of a program, but during the process of the installation, the installation program requires the user to scroll through 10 pages of a license agreement. Since this is coming from stdout and is not a prompt, I am unable to send... (4 Replies)
Hi,
This is my program.
#!/bin/bash
today=`date +"%b-%d-%Y"`
SERVICE="pbxconnect.php"
if ; then
echo "pbx program is running"
else
nohup php pbxconnect.php > logpbx-$today.txt &
fi
On executing using "sh myprogram.sh" , i get the following error.
myprogram.sh: line 4: '
My... (7 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is a problem I am having with my 2 semester senior project. I have a LAMP server running Ubuntu 9.10 with... (8 Replies)
I am working with a script to simplyfy some operations where I work, but one of the programs needs me to enter a password.
It will as me "Please enter the administrator password:"
Is there a way to make a bash script to automatically answer the question with the needed password?
I am looking... (3 Replies)
Hey!
I'm working on a script that will add a user, create some configfiles, and add a crontab for the user.
The crontab looks like the following:
@reboot /home/user/program config.conf &
I would like for this process to start at the end of my script under the corresponding username by... (0 Replies)
Hi
I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (16 Replies)
Hi
I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (1 Reply)
Hi,
I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like
EOF>>
y
EOF
... (4 Replies)
I'm running MAC OS X and I'm wondering how I start 'nixey programs (not normal apps) on startup? Things like the dnet client and hxd Hotline Server. Anyone know? (1 Reply)