Register
It is currently Fri Oct 24, 2014 10:14 pm

Bash basic script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Mar 17, 2014 10:18 am   

Joined: Mon Mar 17, 2014 10:09 am
Posts: 2
Hello. I'm trying to write a simple script that creates another bash script (to run a feed) this bash script only takes the filename as a parameter. I'm getting an error that seems to suggest it's trying to execute the string variable. Here's what my code looks like:

Code:
$str = '#!/bin/bash
echo ======================================
php /dir/subdir/${1}.php arg=true'
$fileName = "/etc/feedz/subdir/${1}.sh"
printf $str > $fileName;


The other problem is it's saying " $fileName: ambiguous redirect".

I'm really puzzled on this one. I know it's simple. Thanks in advance!


Top
 Profile  
 PostPosted: Mon Mar 17, 2014 12:21 pm   

Joined: Mon Mar 17, 2014 10:09 am
Posts: 2
Nevermind, I figured it out. Thanks.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP