![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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 | ||
|
|
|
|||
|
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 |