View Full Version : getting a bash script to run
I'm trying to get ies4linux to run. It's a tar.gz package and the installation instruction seems simple: extract the package and run the program inside. Inside the package is a file ies4linux, but I can't get to run it. I installed bash (the ports version failed so I got the pbi package), but I keep getting a
bash: ie4linux: command not found
So I'm probably doing something wrong. Bash is installed in /bin/bash (at least that's what whereis bash tells me) which is what the script supposes.
molnarcs
03-01-2006, 12:54 AM
Probably the program is not on your path. Which means that you have to run ie4linux like this: ./ie4linux But don't expect it to work. Many progs assume the presence of lots of libs that are missing or in other places on FreeBSD. A quick look at ie4linux showed that it needs cabextract in the first place. And probably wine as well. It probably needs proper porting, which is beyond my skill (mostly).
Tnx. Didn't know about the ./ I already installed wine and cabextract through ports. I tried to run it but it needed wget also. Installed that too, then ran again. Now it's busy downloading IE6. Done as I'm typing. Let's hope the rest goes ok as well. (installing IE now).
scottro
03-01-2006, 03:45 AM
Also note that many programs written for Linux expect bash to be in /bin. In PCBSD it will be in /usr/local/bin/
The top line of most shell scripts for Linux will have
#!/bin/bash
This would have be changed (assuming that everything else would work) to /usr/local/bin/bash.
This is one reason that I give up some of bash's extras to write all my shell scripts with /bin/sh. It makes for portability.
When I do the command "whereis bash", it tells me "/bin/bash", so I guess the pbi version installs where linux installs it. I couldn't get the ports bash version installed (gave me some error) so I can't comment on that.
When I try the same thing as root './ies4linux' it doesn't work however. Is there something different with the root account?
molnarcs
03-01-2006, 09:38 AM
No, it should work with the root account as well. Scrotto is right, bash should be in /usr/local/bin - but it itsn't, because the PBI puts in in /bin. Or if I remember it correctly, it puts a symlink there. In any case, this can burn you in various ways, especially if you use bash as the default root shell.
It's in both /bin and /usr/local/bin. Maybe .pbi installed it in /bin and the one in /usr/local/bin is there after the incomplete ports installation?
this can burn you in various ways
What can be the problems?
molnarcs
03-01-2006, 11:01 AM
One is simply a symlink. But I should file a bugreport against the PBI putting bash (either as symlink or the binary) in /bin, because I got burned by it pretty badly. You see, if you install the PBI, then later the port, your user's default shell will be registered as /bin/bash - but now, there is no /bin/bash, only /usr/local/bin/bash, which means that your user looses its default shell! The problem is even worse if your root shell is bash. I never ever had problems with that until PC-BSD and the BASH pbi. I basically lost my account, could not login, (login did not offer /bin/sh as the shell, because it found bash in /bin, problem was that it pointed to a binary that was not mounted in single user mode).
What I would do is first to change at least the root shell to /bin/csh:
chsh -s /bin/csh
probably I would do the same with my regular user account. Than remove the BASH PBI and any trace of it (the symlink if exists in /bin/). Then install bash from ports - it should work, at least 3.x - I have it installed on my system (make sure your ports are up to date). Then I would try it witha test user, just to see if it works (create a test user, choose bash as his shell, then log in as test and see if everything works as expected). Than change your regular user to bash, and leave root at csh.
The only downside is that you'll have to change #!/bin/bash to #!/usr/local/bin/bash on the top of those scripts that use bash.
I removed the .pbi (it cleared the link in /bin automatically) and updated the system. Bash seems to install without problems now.
To be honest I don't understand what you are saying, but I'll look into that. If you can tell me where to file a bug report (I don't find a link) I'll point it to your post.
molnarcs
03-01-2006, 12:02 PM
No problem - it's complicated I know. You don't need to file a bug report :) I'm not sure I need either - the case I described might be an "edge" case, but can bite a user pretty badly. There is a very little chance that someone will run into this, I was just pissed because I did, and spent half a day trying to repair the consequences. It was also partly my fault...
So I'm happy it worked out fine for you :) Have fun!
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.