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
Problem in making shell script girish.batra Shell Programming and Scripting 4 02-08-2008 09:10 AM
making a archive script jimmyc Shell Programming and Scripting 1 09-15-2007 05:02 AM
making script shary Shell Programming and Scripting 2 06-03-2007 05:16 PM
Making flags for my script rcunn87 Shell Programming and Scripting 6 06-29-2006 11:23 AM
Making a script exectuable BuyoCat Shell Programming and Scripting 5 09-07-2005 03:07 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 01-06-2007
npereira npereira is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 2
Need help making a script

Here is what I have:

#!/bin/bash
# Setup year date and month
YR=`date +%Y '{print $6}'`
MON=`date +%b '{print $2}'`
DAY=`date +%d '{print $3}'`
file=$YR$MOY$DOM
# clear
# Dump database using USER/PASS to [filename].[date].sql
mysqldump --user=me -ppass database > database-db.$file.sql

The YR, MON and DAY dont work. Sounds like the data is not getting put into the variable .

What Am i doing wrong?

thanks for the help
  #2 (permalink)  
Old 01-06-2007
Radar's Avatar
Radar Radar is offline
Registered User
  
 

Join Date: Dec 2006
Location: Clifton Park, NY
Posts: 86
At first glance it looks like you meant to pipe to awk, however, date +%Y does'nt yeild a sixth position to print so the variable is empty.
  #3 (permalink)  
Old 01-06-2007
npereira npereira is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 2
Quote:
Originally Posted by Radar
At first glance it looks like you meant to pipe to awk, however, date +%Y does'nt yeild a sixth position to print so the variable is empty.

ok thanks

That's what it was.
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 05:23 PM.


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