English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a shell script which i need to run but i dont want it to ask for inputs form the user, but rather take it from a file, is it possible, i have used installation scripts which do it. Can any one please help

thanks

2006-09-25 07:03:51 · 2 answers · asked by harimack 2 in Computers & Internet Programming & Design

It is UNIX (RedHat LINUX)
When i run my shell script checkout.sh , it actually checksout source from CVS, but it askes for password and confirmation before doing so, which i want to put in a inputfile, instead of typing in.

2006-09-25 07:36:27 · update #1

2 answers

Do you mean in UNIX?

command_that_needs_input < input_file > /dev/null

"< input_file" uses the contents of a file as input.
"> /dev/null" dumps the output to nothingness.

2006-09-25 07:15:33 · answer #1 · answered by muon 3 · 0 0

most shell scripts take input from a file just by using the redirect operators (< > and |). I can't think of a specific example right now, but what you are looking for would be to use {command} < {input file}


As far as saving password and stuff in it, I seriously recommend against it, and I am also not sure if it will work or not. CVS itself isn't asking for the password, your CVS server is. You would probably be better off setting the server to allow CVS access without a password and configuring the firewall to block requests that are coming from a different IP.

Also, unless you are setting up a new repository or something, you should only need to checkout the first time. It is probably promting you to confirm because you are running checkout on an already created directory, instead you should run "cvs update" which will get all of the updated code and merge it with what you have.

2006-09-25 07:46:18 · answer #2 · answered by John J 6 · 0 0

fedest.com, questions and answers