shell scripting tip

suppose you want to write a script to install postfix-mysql package ( example ) and youdonot want intruption while the scripts executes you add the -y switch to the apt-get command.

#!/bin/sh

echo "this is a script tp install postfix fro virtual domains "

apt-get install -y postfix-mysql

or you can also try

#!/bin/sh echo "this is a script tp install postfix fro virtual domains " #apt-get install -y postfix-mysqlapt-get install postfix-mysql <<>

y

END

if you wan to install many packages ( put in loop )

#!/bin/sh

echo "this is a script tp install postfix fro virtual domains "

for package in package1 package2 package3

do apt-get install $package <<>

y

END

done

hope this helps you!!!!

No comments:

Other Articles

Enter your email address: