View Single Post
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#4
Originally Posted by kingoddball View Post
You're a hero! You come out of nowhere and save the day! AGAIN!
NP breh, What is more important is you understand the script so that in the future you will be better at writing 'em.

Code:
#!/bin/sh
cd /specified-folder/
You clearly know what that stuff is.



Code:
echo "dpkg -i *.deb" | root
Here we use the pipe '|' it is a special unix character that essentialy allows us to direct the output of a program to another program. In this example, the 'echo' command simply echos whatever parameter you give it. In this case 'dpkg -i *.deb'. This string is enclosed in quotes so the echo program knows it is a single string.

So echo echos that string back to us, we then use pipe to direct that string to the program root. (root is of course 'root shell', the land of sudo.)

So in essence we have:

SAY 'dpkg -i *.deb' TO root



Code:
echo "job done!"
echos 'job done' to the current shell, as we are working on the current shell we see job done!

comprende?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post: