How can I read files from the floppy in RedHat7.1


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I read files from the floppy in RedHat7.1
# 1  
Old 10-09-2001
How can I read files from the floppy in RedHat7.1

Can anybody tell me how can I read files from floppy. The files which are written in dos format. What I want to do is read files which I have on my Windows Machine and read those files On RedHat7.1 Machine. When I do this command
mount -t msdos /dev/fd0 mnt/floppy
I can see the files and I copy the files to some other directory but the problem is I can't execute those files. If I do "cat" command it shows all the contents of the files but you can't do "gcc" or just simply want to run that script like this "./Scriptname". It gives me an error that file or directory not present.
If anyone knows please let me know.

-Iftikhar
# 2  
Old 10-10-2001
If you're running a script, the first thing to check is the sh-bang at the top of the file:

head -1 Scriptname

#!/bin/sh
or
#!/path/to/executable

Or which ever it may be. Next, verify that it's pointing to the correct place:

ls -l /bin/sh
or
ls -l /path/to/executable

If that doesn't work, there's your problem. You'll need to change the top line of the script to reflect where the shell it's calling is.

Also, if the file is binary (a program) it may have been damaged by being written to various filesystems. Also, it may not have been compiled to your system, in which case it can't use/find the shared libraries it was compiled to use. You probably won't be able to fix that easily... the best way would be to re-compile it, or get a binary built for your system.

One more thing, make sure the file is executable. Do a :
chmod u+x Scriptname
to set the eXecute bit.

One last thing, nake sure you are typing the file name exactly as it appears - Unix is case sensitive...

If that doesn't work, can you give us a little more information? The exact error, the script, etc...

Hope this helps!
# 3  
Old 10-10-2001
Ooh, one more thing, since the file was written in msdos format, it may very well have <cr> characters on the end of each line. Many modern editors will simply ignore these, but the shell may not like it. Try the dos2unix command to "fix" the file.
man dos2unix
# 4  
Old 10-10-2001
I am using the line
#!/bin/sh
which I know is correct. But the problem is when ever I use this command
./Filename
to execute a script it says the
" The file does not exist"
Then what I did was I used cat command like this
"cat Filename" and it printed the whole file. Which shows that the file is in the directory but for some reason it is not executing. I can use my "vi" editor or emacs editor to make changes but the problem still lies is that whenever I try to run that script it just throws this error
"File or Directory does not exist"
And I know that my scripts are fine becuase I have used telnet to use another Unix Terminal which is Solaris and that script works just fine on that system. It will work fine on my computer once it will find my files in the directory.
Please help me out here. I just can't use my data from that DOS machines.
-Iftikhar
# 5  
Old 10-10-2001
Can you try this:
After the #!/bin/sh line, place into the file
set -x.

It will echo out what is happening, so you can see where it gets lost, if it even begins... You can paste the result back here, if you'd like. In that case, though, it would be helpful if you pasted the script, if it's not too large.

Also, have you tried "auto-complete"ing the file? Type the first few letters of the name, and hit the [Esc] key twice. If it's executable, and the file exists (it'll fill in any odd non-printing characters, if it needs to), it should finish the filename for you.
# 6  
Old 10-11-2001
I tried to use that escape command it reads and auto completes the file name but for some reason whenever I try to run the file it says
File or Directory does not exist.
I am running the file like this
./FileName.
It is very strange, I have talked to several people they are surprised too. It is not even reading or getting into the files so set -x command will not get executed too. And it is not getting executed. Please help me out.
Regards
-Iftikhar
# 7  
Old 10-11-2001
Very odd... can you possibly paste the script here, if it's not too large?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

[REDHAT7] Adding LVM volume

Dear community, is it possible to add more volumes to actual LVM disk? I have the following: # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 120G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 ... (0 Replies)
Discussion started by: Lord Spectre
0 Replies

2. Shell Programming and Scripting

Read files in shell script code and run a C program on those files

HI, I am trying to implement a simple shell script program that does not make use of ls or find commands as they are quite expensive on very large sets of files. So, I am trying to generate the file list myself. What I am trying to do is this: 1. Generate a file name using shell script, for... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

3. Shell Programming and Scripting

How to read log files from last read

Hi i am looking a way to look at a log file(log.txt) from the last time I've read it. However after some days the main log file(log.txt) is rename to (log.txt.1). So now i will have two log files as below. log.txt.1 log.txt Now, i have to read the log from the point where i have left... (3 Replies)
Discussion started by: sumitsks
3 Replies

4. UNIX for Advanced & Expert Users

read() wont allow me to read files larger than 2 gig (on a 64bit)

Hi the following c-code utilizing the 'read()' man 2 read method cant read in files larger that 2gig. Hi I've found a strange problem on ubuntu64bit, that limits the data you are allowed to allocate on a 64bit platform using the c function 'read()' The following program wont allow to allocate... (14 Replies)
Discussion started by: monkeyking
14 Replies

5. SCO

Read Floppy disk in SCO OpenServer 5.0

help me please i am beguinner in SCO operating system how i can read Floppy disk i install SCO OpenServer5.02 i want to /mnt but no result (3 Replies)
Discussion started by: walidfinder
3 Replies

6. UNIX for Dummies Questions & Answers

regarding floppy

Regarding floppy drive .. I need a command or a method by which i can detect a floppy drive is present or not ? Thanks, Priya. (4 Replies)
Discussion started by: priyam
4 Replies

7. Solaris

Can't read floppy and cdrom in single user mode

I am having trouble reading floppy and crom in single user mode. running volcheck doesn't do anything I am using Solaris -10 on Sun blade 150. Has anybody seen this problem .. or do I have to manually mount the cdrom ...and floppy ??? thanks (2 Replies)
Discussion started by: ajnabi
2 Replies

8. SCO

Read a SCO floppy disk under another OS...

I have formatted a floppy disk under SCO unix. Is there a way I could read this disk under another operating system e.g. Windows or Linux? (1 Reply)
Discussion started by: sgertsos
1 Replies

9. UNIX for Dummies Questions & Answers

How do i access (mount, read & write) a floppy disk from the console, not being root?

welll, the title quite explains what i want to do thanks for your time! (4 Replies)
Discussion started by: kfaday
4 Replies

10. UNIX for Dummies Questions & Answers

SFR Files on floppy tobe access in windows

I have here a UnixSlackware 2.01 disk that contains a so called SFR files, i want to open it on windows system since i dont have a unix system, is it posible ??? i tried to install WIPRO UWIN (korn shell) on my windows system but i cant access the floppydisk... so is there a posible solution... (1 Reply)
Discussion started by: mharck29
1 Replies
Login or Register to Ask a Question