found a weird bug in linux

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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 :censored:.

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
Honk if you love Jesus, text if you want to meet Him!
Joe
Posts: 717
Joined: Tue Jun 29, 2004 7:06 pm

found a weird bug in linux

Post by Joe »

hmmm that never happens with windows

Archived topic from Anythingforums, old topic ID:858, old post ID:8834
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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. :D

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
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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. :rolleyes:

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
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post by Red Squirrel »

NO!!!

It started doing it to my cron scripts too. :(

Stupid piece of :censored:.


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 :censored:.


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
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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 :censored:. 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
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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. :lol:

Archived topic from Anythingforums, old topic ID:858, old post ID:9536
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
The Gheyness
Posts: 1111
Joined: Sun Jun 27, 2004 12:40 am

found a weird bug in linux

Post 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! :tongue2:

Archived topic from Anythingforums, old topic ID:858, old post ID:9941
I'm not adopted and I'm not an Indian.
It's just a coincidence that I have
a love of gambling and booze
and a knack for catching syphilis.
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

found a weird bug in linux

Post 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!  :tongue2:
you haven't been on, when i go on msn, loverboy. :P

Archived topic from Anythingforums, old topic ID:858, old post ID:10100
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
The Gheyness
Posts: 1111
Joined: Sun Jun 27, 2004 12:40 am

found a weird bug in linux

Post 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
I'm not adopted and I'm not an Indian.
It's just a coincidence that I have
a love of gambling and booze
and a knack for catching syphilis.
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

found a weird bug in linux

Post 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. :D

Archived topic from Anythingforums, old topic ID:858, old post ID:10112
Honk if you love Jesus, text if you want to meet Him!
Locked