linux - bash script writing shell commands -
why commands require echo statement others can written without:
#!/bin/bash
aptitude upgrade
echo "mysql-server-5.1 mysql-server/root_password password $db_password" | debconf-set-selections
the commands feed on stdin input process, fed echo command. echo dumps string provided on stdout, in turn duplicated on stdin using pipe "|". commands not require input stdin or uses other method of input process can written without echo command.
Comments
Post a Comment