LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2005, 10:03 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question Shell Programming


I'm knid of new to shell script programming. Not a newbie, but not a master either.

Could anybody tell me what's going on here?

I want to write a line that says the actual date in a file. The filename is stored in the variable $config

I added this command to the script:
Code:
echo date $(date) > $config
But when ir runs,I get this error message:
Code:
/sbin/dhclient-script: line 39: $config: ambiguous redirect
I'm writing a hook for dhclient-script

What's going on? I bet it's basic stuff
 
Old 06-02-2005, 10:45 AM   #2
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Rep: Reputation: 15
Can a mod move this to programming please?


Maybe this?
Code:
#put date at beginning of file:
cp "$config" temp
date > "$config"
cat temp >> "$config"


#put date at end of file:
date >> "$config"
Mendel Cooper's bash scripting guide
 
Old 06-02-2005, 11:21 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
The problem was that I wasn't setting the variable the right way. In other words, it was empty.

Sorry to bother in this forum. It wasn't my intention to.
 
  


Reply



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
Shell programming quan Programming 8 11-27-2005 07:46 PM
shell programming qerf Linux - Newbie 5 11-06-2005 05:28 PM
programming shell tuls Slackware 3 08-24-2005 05:58 PM
new to shell programming bluetwist Debian 3 08-01-2005 03:56 PM
shell programming shadowsurfer Linux - Newbie 3 09-09-2004 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:28 PM.

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