|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Ok for the record let me start off by saying I'm *very* new to Suse and fairly new to linux in general. Anyway I have to install some software for school purposes, it's basically a program that submits homeworks. Anyway it's packaged as a shell script which when ran is supposed to unzip various .rpm's. When I run the script from terminal using . <script name> though it returns the following.
LPL v2.5.0 - starting installation. awk: cmd. line:1: fatal: cannot open file `bash' for reading (No such file or directory) . extracting RPMs tail: +: invalid number of lines gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error exit delayed from previous errors . installing RPMs error: File not found by glob: *.rpm Installation complete (if no errors were shown!). Script done, file is mysession.log Now being new to linux I have only a feint idea of what's even going on in that error and even less of an idea on how to fix it. However any help would be greatly appricated in fact if someone can fix this for me they'll officially be my savior. Need it to run for school after all. |
|
|||
|
The construct
. file doesn't run a script. What it does is read in the file and execute the lines in it as if they had been typed into the current shell. The difference could be important. To run a script, do chmod u+rx script ./script Do that and post the results. |
|
|||
|
Quote:
![]() For the record though, just in an effort to learn. What is the difference between ./ and just . ? |
|
|||
|
"./script" runs the script in the current directory. It actually runs the script in a separate process. ./ is just a prefix to refer to a file in the current directory.
". file" is called sourcing the file. It can also be typed in as "source file". It reads the contents of the file into the current interactive shell as if you had typed them in. It's not the same thing as running the script. For details see man sh. |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|