Page 1 of 1
found a weird bug in linux
Posted: Sun Aug 22, 2004 2:57 pm
by Red Squirrel
ok this is weird... I'm trying to execute a script and this is what I get:
Code: Select all
[root@mailserver temp]# ./scadalog_put
: No such file or directoryta/shared/scadadump.sql
: command not founde 2:
[root@mailserver temp]#
The script is:
Code: Select all
/usr/local/mysql/bin/mysql -h localhost -D business -uroot -p12345678 </data/shared/temp/scadadump.sql
All the paths are right since if I do it manually it works.
Anyone know what the heck is going on? Should I just reinstall red hat, since obviously something is way wrong. command not founde !?
Archived topic from Anythingforums, old topic ID:858, old post ID:8805
found a weird bug in linux
Posted: Sun Aug 22, 2004 7:36 pm
by Red Squirrel
Ok I think this is more of a bug in mysql since other commands are working fine. It's doing it again to any restore command.
Code: Select all
echo restoring forum...
/usr/local/mysql/bin/mysql -u root -p12345678 -h localhost iceteks_reliexec</data/shared/temp/forum.sql
echo restoring articles
/usr/local/mysql/bin/mysql -u root -p12345678 -h localhost iceteks_articles</data/shared/temp/articles.sql
echo restoring scada
/usr/local/mysql/bin/mysql -u root -p12345678 -h localhost iceteks_scada</data/shared/temp/scada.sql
echo restoring front page news
/usr/local/mysql/bin/mysql -u root -p12345678 -h localhost icetek_frontpagenews</data/shared/temp/news.sql
echo done
WTF? If I copy and paste it in the console, it works... but I don't want to do that, I want to be able to just type ./restore_databases and boom, it executes all of it.
Oh and it keeps referring to lines that don't even have anything in them.
Code: Select all
restoring forum...
: No such file or directory /data/shared/temp/forum.sql
: command not found line 3:
restoring articles
: No such file or directory /data/shared/temp/articles.sql
: command not found line 6:
restoring scada
: No such file or directory /data/shared/temp/scada.sql
: command not found line 9:
restoring front page news
: No such file or directory: /data/shared/temp/news.sql
: command not found line 12:
done
: command not found line 14:
This thing is
.
If I just remove the spaces, it still screws around with me.
Code: Select all
restoring forum...
: No such file or directory /data/shared/temp/forum.sql
restoring articles
: No such file or directory /data/shared/temp/articles.sql
restoring scada
: No such file or directory /data/shared/temp/scada.sql
restoring front page news
: No such file or directory /data/shared/temp/news.sql
done
[root@mailserver temp]#
Archived topic from Anythingforums, old topic ID:858, old post ID:8831
found a weird bug in linux
Posted: Sun Aug 22, 2004 9:03 pm
by Joe
hmmm that never happens with windows
Archived topic from Anythingforums, old topic ID:858, old post ID:8834
found a weird bug in linux
Posted: Sun Aug 22, 2004 10:08 pm
by Red Squirrel
Joe wrote: hmmm that never happens with windows
I know, scarry huh. Only problem is that those commands mean nothing in windows, well you
can have mysql run under windows, but weather or not it actually works as well as in linux is a different story.
Been playing wtih that all night, just can't figure out why it's doing this. Pissing me off since it's delaying me in everything. I wanted to redesign my site, but I can't until I get this figured out.
Archived topic from Anythingforums, old topic ID:858, old post ID:8837
found a weird bug in linux
Posted: Sun Aug 22, 2004 11:34 pm
by Red Squirrel
man this sucks.... it just does not make sense. If it works manually, it should work in a script. That's how msdos batch files work. whatever works manually works in a batch file. But linux is too different and too complicated so it's not that easy.
I guess I'll have to revert to doing the whole thing manually. I can just copy and paste it in the console or something.
Archived topic from Anythingforums, old topic ID:858, old post ID:8854
found a weird bug in linux
Posted: Mon Aug 23, 2004 3:16 am
by megaspaz
do you have a she-bang line as your first line of your script? post your complete script code.
Archived topic from Anythingforums, old topic ID:858, old post ID:8861
found a weird bug in linux
Posted: Mon Aug 23, 2004 5:58 pm
by Red Squirrel
That is the complete script. I was also told at another forum to put something like #!/bin/sh (forget exactly what) but it did nothing either. Thing is, if I copy and paste the script in the console it works. So if this get's too complicated I'll just have to revert to that. But technically a script is the same as typing it, no?
Archived topic from Anythingforums, old topic ID:858, old post ID:8892
found a weird bug in linux
Posted: Mon Aug 23, 2004 8:41 pm
by Red Squirrel
NO!!!
It started doing it to my cron scripts too.
Stupid piece of
.
Ok, so what's a decent distro that's easy to use? I think this is time to switch to something more up to date. Since red hat got ditched there's not really any decent distros anymore. I heard fedora is crap, I heard mandrake is buggy, I tried slackware but I can't even figure out the install... So what else is there? And I want it to run on the hard drive, no CD install thingy... this is a server here and speed and reliability is a big issue and an ATA 66 drive is not the solution.
Thanks in advance. Man, like I actually have time for this, but obviously this install is
.
Oh, and I noticed it's only doing it to new scripts that I create, old ones are still working. So maybe I can trick it into thinking it's old. Is there a command to change the file date? I might as well give this a try before reinstalling and risking all my business data. I kno wnothing of linux so chances are I'll screw something up and wipe all partitions or something. It's just too common for n00bs like me to do this.
Archived topic from Anythingforums, old topic ID:858, old post ID:8920
found a weird bug in linux
Posted: Mon Aug 23, 2004 8:47 pm
by Red Squirrel
Oh and another problem, when I create a file, such as copying, moving, etc... it creates it as a folder. It's probably related somehow.
I noticed my log file is now a backup.log file with the windows icon, instead of having the icon of my text editor, what's even more dumb is that it did not overwrite the existing .log file, so I have 2 backup.log files in the same folder, one is a valid file, and the other is
. The valid one is the same size as before, and the invalid one has the data that's should of been appended to the real .log file.
Archived topic from Anythingforums, old topic ID:858, old post ID:8921
found a weird bug in linux
Posted: Mon Aug 23, 2004 9:33 pm
by megaspaz
add in this line as the very first line of your script:
#!/bin/bash
check your permissions if you made your scripts executable.
script permissions are normally rwx-r-x-r-x
if you don't make your cron scripts executable nor have a she-bang line, it won't run.
in your case, it looks like your computer got hosed by either something you did or something someone else did. i don't know which. have you been checking if you got rooted?
http://64.233.167.104/search?q=cache:a7mBu...&hl=en&ie=UTF-8
it's a google cached page.
Archived topic from Anythingforums, old topic ID:858, old post ID:8930
found a weird bug in linux
Posted: Mon Aug 23, 2004 9:36 pm
by Red Squirrel
Yeah I had tried that. Someone had told me to put sh instead of bash, but I had also tried bash with the same results.
at this moment echo seems to be about the only command that works in a script file. This is weird since maybe like months ago I created a bunch of scripts and they worked, and still do, but if I reproduce them now, they won't work. But if I use the old ones, they do. Also what is rwx-r-x-r-x? Is that 777? Since that's what I set all the scripts to. (only way it lets me even execute them, otherwise I get access denied)
Archived topic from Anythingforums, old topic ID:858, old post ID:8932
found a weird bug in linux
Posted: Mon Aug 23, 2004 9:40 pm
by megaspaz
r = read permission
w = write permission
x = execute permission
in octal, rwx-r-x-r-x would be 755.
Archived topic from Anythingforums, old topic ID:858, old post ID:8934
found a weird bug in linux
Posted: Fri Aug 27, 2004 6:11 pm
by Red Squirrel
hmmm turns out bash does not like scripts that were made in windows. So the only way is to type up the script in vim directly on the server. More trouble, but at least I found out why it was crapping out and now it means it's not linux that's screwed up. I rather find out it's my own fault then to realize I need to reinstall or fix something.
Archived topic from Anythingforums, old topic ID:858, old post ID:9536
found a weird bug in linux
Posted: Sat Aug 28, 2004 3:44 am
by megaspaz
as long as your script is in plain text (ala written in notepad or some other plain text editor) linux should have no problems reading and executing the script.
Archived topic from Anythingforums, old topic ID:858, old post ID:9656
found a weird bug in linux
Posted: Sat Aug 28, 2004 12:32 pm
by Red Squirrel
Not as it apears, since I wrote it with winsyntax which is like notepad but without the 64K limit and shows line numbers. But I think it saves in unix format by default so maybe notepad would work. I think it has to do with the way returns are made. Unix format is
or something while windows is just
but I forget exactly how it works.
Archived topic from Anythingforums, old topic ID:858, old post ID:9690
found a weird bug in linux
Posted: Sun Aug 29, 2004 12:14 pm
by megaspaz
Red Squirrel wrote: Not as it apears, since I wrote it with winsyntax which is like notepad but without the 64K limit and shows line numbers. But I think it saves in unix format by default so maybe notepad would work. I think it has to do with the way returns are made. Unix format is
or something while windows is just
but I forget exactly how it works.
actually it's the other way around. ms uses a return and line feed character. *nix uses one or the other, i believe it's just a return character in *nix. but linux can read and write documents using the windows style of return and line feed charcters.
Archived topic from Anythingforums, old topic ID:858, old post ID:9932
found a weird bug in linux
Posted: Sun Aug 29, 2004 3:32 pm
by The Gheyness
Spaz, you sexy beast, how come I haven't seen you on MSN lately?!
Sure, I was gone for like a month or so there, but that gives you no right!
Archived topic from Anythingforums, old topic ID:858, old post ID:9941
found a weird bug in linux
Posted: Mon Aug 30, 2004 12:10 am
by megaspaz
Legend wrote: Spaz, you sexy beast, how come I haven't seen you on MSN lately?!
Sure, I was gone for like a month or so there, but that gives you no right!
you haven't been on, when i go on msn, loverboy.
Archived topic from Anythingforums, old topic ID:858, old post ID:10100
found a weird bug in linux
Posted: Mon Aug 30, 2004 12:39 am
by The Gheyness
I only sign on for a sex, I mean sec, to see if you're on and then I leave usually, since I have barely any friends on MSN.
And you haven't been on!!111111!
Silly Pacific time zone. One day we're gonna wise up and do something about those unimportant states like California.
Archived topic from Anythingforums, old topic ID:858, old post ID:10102
found a weird bug in linux
Posted: Mon Aug 30, 2004 8:11 am
by Red Squirrel
They need to standardize internet swatch time. Not only for the internet, but for the real world too.
It would sound so cool to plan a date for 969 time or something.
Archived topic from Anythingforums, old topic ID:858, old post ID:10112