LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2014, 04:55 AM   #1
desiretolearn
LQ Newbie
 
Registered: Jan 2014
Posts: 25

Rep: Reputation: Disabled
overcome the error


i want to run my script using cron for every minute it must terminate after specified number of execution
my code
head -n 2 samp.csv > a.csv

Last edited by desiretolearn; 02-04-2014 at 04:04 AM.
 
Old 02-03-2014, 05:29 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
First error is because the space after [ and before ] are mandatory:
Code:
if [ $run -eq 10 ]; then
The second one is because variables names cannot start with a number as in 1=1000.
 
Old 02-03-2014, 05:41 AM   #3
desiretolearn
LQ Newbie
 
Registered: Jan 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
it is still stating that
head: cannot open `samp.csv' for reading: No such file or directory
sed: can't read samp.csv: No such file or directory
tail: cannot open `samp.csv' for reading: No such file or directory
tac: cannot open `samp.csv' for reading: No such file or directory
split: cannot open `samp.csv' for reading: No such file or directory

what might be the reason??
 
Old 02-03-2014, 05:47 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Well, the file samp.csv is not inside the current working directory.
 
1 members found this post helpful.
Old 02-03-2014, 05:47 AM   #5
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You need to give the full path to the file - it cannot find it in the current directory.
 
1 members found this post helpful.
Old 02-03-2014, 06:17 AM   #6
desiretolearn
LQ Newbie
 
Registered: Jan 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
yup it did it work

but my counterfile
Quote:
a.log
does not increment each time when the cron is executing my script
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail server issue--Suggestion required aq_mishu Linux - Server 5 10-28-2010 11:29 AM
Suggestion required: Firefox crashes unexpectedly!! owaispoul Linux - General 7 02-07-2010 04:19 AM
Suggestion required for research in Linux burak Linux - General 1 08-22-2008 01:23 AM
suggestion required nsampath Linux - Software 1 04-05-2007 06:23 AM
kernel Version suggestion required mystic_durle12 Linux - Kernel 2 11-06-2006 05:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:19 AM.

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