![]() |
Scripting Help Required - DPKG
Hello!!
I need a little help with scripting. I want to install a .DEB from a script (4 in totoal). I had the idea, but did not go right.. Essentially I want this: (located in MyDocs) Code:
#!/bin/sh I use dpgk -i to install these *.deb files normally. Please help. :o |
Re: Scripting Help Required - DPKG
Quote:
Code:
#!/bin/sh |
Re: Scripting Help Required - DPKG
You're a hero! You come out of nowhere and save the day! AGAIN! :D
|
Re: Scripting Help Required - DPKG
Quote:
Code:
#!/bin/sh Code:
echo "dpkg -i *.deb" | root 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!" comprende? |
Re: Scripting Help Required - DPKG
Unfortunately this keep throwing errors.
Using the same as you posted: dpkg: error processing *.deb (--install): cannot access archive: No such file or directory. Errors encounered while processing: *.deb (I have also added the start of the filename). When I do it using the full filename: Error is: ./script line 6: syntax error: "|" unextected Edit: If I remove the pipe | all it does is echo the words :( I am doing all this on the N900 if thats any different. |
Re: Scripting Help Required - DPKG
oopz
As the *.deb is in the quotes it is being treated as a literal string as opposed to a globbed expression. Replace the line with: Code:
sudo dpkg -i *.deb |
Re: Scripting Help Required - DPKG
Code:
#!/bin/sh |
Re: Scripting Help Required - DPKG
You're excellent!
I used the one you said that will install all. It worked perfectly! But what would I do to install.. Maybe 2 only. Just seems odd that it failed to install one using the same method. Also: VI_ what does your signature mean/do.... |
Re: Scripting Help Required - DPKG
what does this mean?
Code:
#!/bin/sh |
Re: Scripting Help Required - DPKG
Shell script.
You can also use #!/bin/bash I'm not sure what it fully means in the Linux terminology, the way I know it " this is a script"; |
Re: Scripting Help Required - DPKG
so you should always start with this?
Like saying to your N900, here comes a shell script :p K thanks ;) |
Re: Scripting Help Required - DPKG
I belibe so.
To start the script on Linux/N900 terminal: Code:
./scriptname or if it fails . ./scriptname Type chmod 755 yourscriptname Ch chmod +x scriptname A simple script #!/bin/sh echo "hello. This is pretty cool" That's it. |
Re: Scripting Help Required - DPKG
Quote:
The line essentially tells the computer which interpreter to run the script in. In the above example you are telling the computer to use the interpreter which is called 'sh'. sh is the 'shell'. you could say: Code:
#!/bin/bash Code:
#!/bin/python Kingoddball: My signature is a hilarious joke that apparently makes you a total bastard when you tell it. My signature is a script that randomly chooses a number between 6 and 0, if you get a 0 it runs another script called a 'fork bomb' that crashes your computer. If you get between 1-6 it prints 'you live' and does nothing. It is computer russian roulette. It used to delete everything on your computer if you got 0 but a bunch of people started crying about how mean that is so I changed it at Jedi's suggestion. PS, dont run my signature |
Re: Scripting Help Required - DPKG
Quote:
|
All times are GMT. The time now is 08:14. |
vBulletin® Version 3.8.8