The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Create a file from within a script lamano Shell Programming and Scripting 2 03-04-2009 04:31 PM
create file in script Satyak Shell Programming and Scripting 4 10-19-2008 06:48 AM
To give the "unzip" permissions & "create" file permissions Mike1234 HP-UX 3 03-02-2008 05:34 PM
Create file in script paparazi Shell Programming and Scripting 3 02-26-2008 03:16 AM
script to create tar file ajrandrup UNIX for Dummies Questions & Answers 2 12-03-2003 01:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-08-2009
cesarNZ cesarNZ is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 70
permissions to create log file from script

hi all,
have a script which i am using to generate a log file. i use "touch out.log" command to create the file and later on i want to echo lines to this file.

for some reason it keeps giving me this error when i try and create the file ;

touch: out.log cannot create

i have permissions to create files in the directory where my script sits since its my home directory. so i dont understand what else is wrong ??

directory permissions where my script sits is "drwxr-xr-x"


thanks.
  #2 (permalink)  
Old 06-09-2009
anchal_khare anchal_khare is online now
Registered User
  
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 325
Are you able to create files with other commands?
since you told you want to echo in that file, try to redirect the echo into the file.


Code:
echo "message" >> out.log

and see if it works.
  #3 (permalink)  
Old 06-09-2009
baruchgu baruchgu is offline
Registered User
  
 

Join Date: May 2008
Posts: 13
It looks as permission problem. Check the permission of directoty where you run.
ls -l .
  #4 (permalink)  
Old 06-09-2009
thanhdat's Avatar
thanhdat thanhdat is offline
Registered User
  
 

Join Date: Aug 2008
Location: Paris
Posts: 109
Maybe, u'r not the owner of that file. You can use "chmod +w" to modify the permission of the file
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0