LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-28-2005, 01:16 PM   #1
lobo1
LQ Newbie
 
Registered: May 2005
Posts: 7

Rep: Reputation: 0
Permission Denied for script accessing text file


I have bash shell scripts running on Linux box, RedHat 9. They convert files into XML format by parsing of text files. The text files that are created on the Linux box work fine. But a different sensor creates data/text files on a Windows machine. I move the data/text file from the Windows machine to the Linux box by using a Samba share and just copy the file to the shared (Linux) drive on the Windows box. On the Linux box, my file is in the directory that I am running the scripts on. The problem is, when I run the script to use the data/text file from that originated on the Windows box, I get Permission Denied in the script error message, when it gets to the data/text file. I have tried changing permissions on the file to allow the maximum access. I have also copied the data into a file that I created on the Linux box. I keep getting permission denied. Its just a text file, can there be something inherently different in the text since it was moved from a Windows box, that Linux just cannot read? Any suggestions as to how to proceed are much appreciated.
 
Old 06-28-2005, 01:32 PM   #2
bigfez
LQ Newbie
 
Registered: Mar 2005
Posts: 29

Rep: Reputation: 15
windows uses different line endings than linux, linux uses \n while windows uses \r\n
thats more likely to cause a script to blow-up than throw a permission denied error.

You said you checked and changed permissions, but have you checked ownership?
 
Old 06-28-2005, 01:46 PM   #3
lobo1
LQ Newbie
 
Registered: May 2005
Posts: 7

Original Poster
Rep: Reputation: 0
The file is owned by root as are the Linux originated files which work in the script. Here is the ls -al for the data/text file ALCOGGG.TXT:

-rw-r--r-- 1 root root 112 Jun 27 15:56 ALCOGGG.TXT

I am running the scripts as root as I am working on this problem. Here is the first part of the script:

#Cut the observation data from the text file.
#
FILENAME=/home/aprsd2/ALCOGGG.TXT

if $FILENAME
then


It doesn't get past this line and this is the error message:

./xmlconvGRB5: line 16: /home/aprsd2/ALCOGGG.TXT: Permission denied
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User executing script: bad interpreter: Permission denied stefaandk Linux - Newbie 7 06-27-2005 10:53 AM
crontab failure: permission denied trying to run script hedpe Linux - Software 5 05-03-2005 08:07 PM
/etc/init.d/cyrus Shell Script 'Permission denied' ServerStorm Linux - Software 3 01-20-2005 12:04 AM
permission denied when executing my own script Red Squirrel Linux - Newbie 3 03-07-2004 09:21 PM
Accessing Win2K Shares-permission denied bdog Linux - Networking 4 01-26-2002 08:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration