The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 08:34 AM
Need to read data from a file (cut/awk) rejirajraghav Shell Programming and Scripting 1 04-29-2008 03:13 PM
Post Shell programming: Question about source a file and read data from the file ccwq Shell Programming and Scripting 3 08-04-2007 10:28 PM
Read from data file fongthai Shell Programming and Scripting 12 02-27-2007 09:22 PM
Howto read data into a shell script banjo Shell Programming and Scripting 4 09-06-2006 06:41 AM

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 05-27-2008
fizzme fizzme is offline
Registered User
  
 

Join Date: May 2008
Posts: 1
Help required with a Csh script to read data from a file

Dears,

This is what i want..
I need to read a comma separated text file whose name is config.txt.
whose content is like ;

bscnara,btserrr
bscsana,btssanacity
.....

i need to read the first string and second string and use it to execute a another shell script.

This is the logic.

1 open the config.txt
2 get the first and second varible read from the line
3 use it to execute a script
4 repeat 2 and 3 this end of file.

NOTE: I did the same using ksh, but unfortunately the script works from command line but not from cron, i got the an advice that because the default shell for for my system is csh , my script needs to be written in csh and csh sucks when it comes to redirections.!!
Help required pals....
  #2 (permalink)  
Old 05-29-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
In my opinion that's some bad advice you've been given :/
cron executes commands in your default shell or /bin/sh (depending on cron implementation), but executes scripts in whatever interpreter you put in the #! path at the top (as youd expect running it from the prompt).

I would guess your problem running it from cron is that you are using an environment variable in your script. Cron runs in a very simple environment so you can't take any env vars for granted.
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 09:23 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