Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sh syntax

Posted on 2001-06-19
3
Medium Priority
?
300 Views
Last Modified: 2013-12-16
I am getting a script (in *unix) to output to file using the following:
 
/usr/local/bpc/bids2login -l <username> -f /etc/bpc.login.pw 2>&1 > <log> &
 
where log is of course the specified name of the log file... Now here's the question.. say I want the log file name to be date stamped.. so the log file name would end up being, for example, bids2login02030.log..  how would I modify the above command line to do that? I tried reading the sh man but its in typical unix speak :)
 
Thanks.
0
Comment
Question by:missy041598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:garboua
ID: 6208039
use date command logFileName'date+"%d%m%y"'
this will name the file logFileName190601
for more options on the date comment just do a man date
0
 

Author Comment

by:missy041598
ID: 6208683
Would you be able to provide me with the new command I should use incorporating the above.
0
 
LVL 5

Accepted Solution

by:
garboua earned 200 total points
ID: 6208854
/usr/local/bpc/bids2login -l <username> - /etc/bpc.login.pw 2>&1 > bids2login`date+"%d%m%y"`
notice there are not single quotes, ticks, it the back-tick, located in the same button as the tilde ~, it tells the shell to execute the command first and then produce the string, so your system will resolv date+"%d%m%y" as 200601 then your log will be bids2login200601
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will giveā€¦
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question