Sponsored Content
Top Forums Shell Programming and Scripting "Content-type: text/html No input file specified." Only in CRON but not when executed directly Post 302905112 by phpchick on Monday 9th of June 2014 06:15:40 PM
Old 06-09-2014
"Content-type: text/html No input file specified." Only in CRON but not when executed directly

Hi gang, I have the following code inside a the file script.sh


Code:
#!/bin/bash          
todaysdate=$(date --date='7 day' +'%d')
todaysmonth=$(date +'%m')
todaysyear=$(date +'%Y')
yahoodatestring=$todaysyear$todaysmonth$todaysdate

nicedate=$(date --date='5 day' +'%A')

nice="$nicedate, $todaysmonth/$todaysdate"

dubdub='http://biz.yahoo.com/research/earncal/'
dothtml='.html'
url=$dubdub$yahoodatestring$dothtml


echo $yahoodatestring;

echo $url;


#wget -O thefile.html $url


 sed -n "/align=center>/,/<\/small>/p" thefile.html > step1.html     
 
 sed -n "/<td>/,/<\/td>/p" step1.html > step2.html
 
 sed -n '/N\/A/{s/.*//;x;d;};x;p;${x;p;}' step2.html | sed '/^$/d' > step3.html
 
 sed -n "/\">/,/<\/a>/p" step3.html > step4.html
 
 grep 'finance.yahoo' step4.html > step5.html
 
  sed 's/.\{12\}$//' step5.html > step6.html 
  
  rev step6.html | cut -c -7 | rev > step7.html
  
  cut -d '>' -f2 step7.html > step8.html
  
  php yahoo-pull.php > email.html
  
  tail -n+2 email.html > email2.txt
 
 mail -s "$(echo -e 'Companies Reporting On $nice\nContent-Type: text/html')"  email@gmail.com  <  email2.txt



when I run ./script.sh in the command line, it runs fine and I receive an email to my inbox with the script output. However, when I try to schedule it as a cron, I get an email that says

"Content-type: text/html No input file specified."

To summarize, when the script is run in the command line manually it works, but when it is in cron, I get "Content-type: text/html No input file specified."

Does anybody have any ideas why this happens?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies

2. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

3. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

4. Shell Programming and Scripting

check input = "empty" and "numeric"

Hi how to check input is "empty" and "numeric" in ksh? e.g: ./myscript.ksh k output show: invalid number input ./myscript.ksh output show: no input ./myscript.ksh 10 output show: input is numeric (6 Replies)
Discussion started by: geoffry
6 Replies

5. Shell Programming and Scripting

Creating a Shortcut (to just type "l" but it runs "ls -lah")

How do I create shortcuts? For example: I just want to type one key "l" and have it output the command of "ls -lah" I believe it's creating a file called l with 755 permissions but I'm not sure where to put the file. *if it matters, I'm on a shared hosting web server using cPanel with... (2 Replies)
Discussion started by: ijustsawmars
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Web Development

Why using this kind of format in Web Development <script type="text/javascript"><!-- ...//--></scrip

I am just wondering why do programmers are using this when programming the web? When you making a joomla templates and the more focus in your mind is to target the search engines then java is very important.Not to use that. (2 Replies)
Discussion started by: Anna Hussie
2 Replies

8. AIX

Can we directly edit "/etc/environment" file in AIX using vi ?

Hi Is it recommended to edit the file "/etc/environment" directly using vi ? (like by adding some export something= value staements) or do we need to edit /etc/profile file in order to set the environment variables, globally to the entire AIX LPAR please suggest. (5 Replies)
Discussion started by: System Admin 77
5 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
doctools::html::cssdefaults(n)					Documentation tools				    doctools::html::cssdefaults(n)

__________________________________________________________________________________________________________________________________________________

NAME
doctools::html::cssdefaults - Default CSS style for HTML export plugins SYNOPSIS
package require Tcl 8.4 package require doctools::html::cssdefaults ?0.1? ::doctools::html::cssdefaults::contents _________________________________________________________________ DESCRIPTION
This package provides a single command providing access to the text of the default CSS style to use for HTML markup generated by the vari- ous HTML export plugins. This is an internal package of doctools, for use by export plugins, i.e. the packages converting doctools related documented into other formats, most notably HTML. API
::doctools::html::cssdefaults::contents This command returns the text of the default CSS style to use for HTML markup generated by the various HTML export plugins. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
CSS, HTML, doctools, export, plugin, style CATEGORY
Documentation tools COPYRIGHT
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net> doctools2base 0.1 doctools::html::cssdefaults(n)
All times are GMT -4. The time now is 01:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy