Echo statement and time /t on the same line [closed] - date

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How would I display the following in Batch?:
It is currently 01:58 AM
I have tried echo It is currently && time /t but it displays
It is currently
01:58 AM

You can do something like this :
#echo off
FOR /F "tokens=1,2" %%A IN ('time /t') DO Echo It is currently %%A %%B
For more info Link.

Related

Powershell solution required [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 days ago.
Improve this question
I have many text files in directory and sub directories. I want to add a Tab character before Device_Id but line must not contain Sender_Ip.
Device_Id is present in both lines either it's having Sender_Ip or not. I could replace Tab character but had replaced in both types of lines whereas I just want it to be replaced where Sende_Ip is not present.

Is there a psql client config file analogous to $HOME/my.cnf for mysql ? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
That is, a local file on the client machine with default "host", "port", "user" values, etc., so that I don't have to enter them on the command line each time?
Use the password file with lines like:
hostname:port:database:username:password
If you always log into the same host:db:port:user then this will make it:
*:*:*:*:mypassword
You can either define one (or several ) alias to psql with the proper arguments for user, database, host. Or set some environment values.

Replace the mixed pattern with preg_replace() on a directory path string [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to remove "Documents/1/project/1/sub/15/"
from the whole text srting
"Documents/1/project/1/sub/15/Project 1_1/2012-09-10/0a/0ad0175615742c7a3142cd0ecc4c3277/19-50-24-10233310.txt"
But the numbers 1,1 and 15 will not be same always.It will change.
Desired result : "Project 1_1/2012-09-10/0a/0ad0175615742c7a3142cd0ecc4c3277/19-50-24-10233310.txt"
Solved it.
preg_replace('/(Documents/.+?)+(/project/.+?)+(/sub/.+?)+(/)/i','',$str)

How to use a argument with space in a batch file [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
i needed to pass some arguments to a exe, but one of the argument was having a space
the code is
myApp.exe arg1 arg 2
This created a problem as the second argument was split into two.The work around i did was like
myApp.exe arg1 'arg 2'
this helped in passing argument with space as a single argument
Enclose them in double quotes:
myApp.exe arg1 "arg 2"

Arch Linux - How to pass arguments to daemon in rc.conf [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
If I add a daemon to rc.conf, how can I then pass arguments to it?
Eg
DAEMONS = (sshd mongodb ...)
How can I pass --replSet to the mongodb daemon?
You should try to set this behaviour in /etc/mongodb.conf
I don't think you pass anything, it calls the daemon from /etc/rc.d/ so you'd edit that script with the args.
EDIT: here are some links that explain:
https://wiki.archlinux.org/index.php/Rc.conf#Daemons
https://wiki.archlinux.org/index.php/Writing_rc.d_scripts