The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please help me regarding alias naree Shell Programming and Scripting 17 06-03-2008 01:14 AM
How to get the alias,when we have the IP. preethgideon UNIX for Dummies Questions & Answers 2 07-24-2007 11:53 AM
alias help shafique UNIX for Dummies Questions & Answers 5 10-03-2006 09:56 AM
alias klannon Filesystems, Disks and Memory 6 04-27-2006 05:36 AM
using alias... DebianJ UNIX for Advanced & Expert Users 2 05-12-2005 06:31 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-14-2001
sskb
Guest
 

Posts: n/a
alias

I used an alias to generate a log file for an application to produce the log file with time of invoking like this

alias app org_app -log `date| cut -c 5-7,9-10,12-13,15-16,18-19`.log

and I entered in the .cshrc file.
but the date is stored when I invoke the .cshrc file.
so, if in a same session, I invoke the application several times, i get my log file overwritten.

Is there a solution for this?

Forum Sponsor
  #2 (permalink)  
Old 12-15-2001
Jimbo
Guest
 

Posts: n/a
If you place the alias assignment in single quotes, then the expression will get stored as is. Without the quotes, it will store the evaluation of the expression, which would be good for locking in an evaluated expression to remain static for duration of the session. In the following, the date command will return the same value as your "date|cut".

alias app 'org_app -log `date +%b%d%H%M%S`.log'

To see what is getting stored for the alias, type:
alias app
  #3 (permalink)  
Old 12-17-2001
sskb
Guest
 

Posts: n/a
thanks Jimbo,
that's just what I wanted.
It's wonderful
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0