Programming :: Print The Current Time Of My System With A Batch File ?
Dec 25, 2010How can I print the current time of my system with a batch file. My os is ubuntu.
View 4 RepliesHow can I print the current time of my system with a batch file. My os is ubuntu.
View 4 RepliesHow do I do this?The script below obviously dosn't work.
#!/bin/bash
for u in $(awk '{print $2}' user.txt)
for i in $(awk '{print $1}' user.txt)
[code]...
One text file with two columns in it, I need to iterate through the file and print the different columns each time
Is there a way to get the current time as provided from NTP (not the currently set time on the server)?
View 4 Replies View RelatedI need to write a windows batch file to run unix commands by logging onto a telnet unix server. For example , I might want the batch file to log onto the unix sever, run the ls command, collect the output in a file and ftp it back to my windows desktop
View 8 Replies View RelatedCode:
#if defined(WIN32) || defined(WIN64)
#define WINDOWS
#endif
[code]....
what is the directive thats required to detect a linux system? i want to to be able to detect which platform im compiling on automatically.
I'm looking for a function (prefer POSIX, but Linux specific would do if it has to) to get the current timezone offset. For my location, eastern USA, that should be -14400 when daylight time is in effect, and -18000 otherwise.
View 1 Replies View RelatedI've search the web, but didn't find anything specific to what I'm trying to do. Is it possible to batch print all files in a directory from the CLI? I'm sure it is, I just haven't found the right package. It can be done with OpenOffice, but the files are all PDFs.
View 3 Replies View RelatedI am reading about jiffies in linux kernel. In one of the related example in the book Linux Device Driver, the author use
head -8 /proc/currentime
to print out some time information.
However this file is not present in my linux installation (kernel: 2.6.32-131.6.1.el6.x86_64). Why is it the case? Is it because the file path is no longer valid, or it is a distribution feature thing? It is not present in OSX too. What would be an equivalent in OSX?
I need to write a batch file for windows that automatically starts the cygwin tool in windows and executes the unix scripts.Previously we had these scripts in unix server.Now we need to migrate them to Windows server.For this reason we are using cygwin tool that allows the scripts to be executed on Windows server.We had written a batch file that starts the cygwin tool,but we were not able to execute the unix scripts.How can we write a batch file such that it executes all the unix scripts in cygwin.
View 5 Replies View RelatedI am trying to set a home file and print serverwhile learning about Linux at the same time. How ever I have hit a wall...I am trying to install samba but I have the following messages...
Urbie:~# apt-get install samba
Reading package lists... Done
Building dependency tree
[code]....
Actually I suppose to use this "htop" command to get the system utilities like current processor speed ,running programs ,memory usage(ram and swap) to my program. I planned to get it using popen(). I was success popen("top | grep Mem", "r") with top command. But are there a way to take such information using "htop". Or are there any idea of taking current CPU,MEM,Swp usage as well as Tasks and running tasks using htop or other way to C program...
View 1 Replies View RelatedI have this code:
How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.
I want to write a script that returns me name of the files that begin with the specified characters. like
Script out should be
Under a Linux shell, how can I change the creation time of all a folder's files to the current time?
View 2 Replies View Relatedwhy this code can't print in the while loop the content of the file ?
Code:
#include <stdio.h>
int main()
{
FILE *fp;
[code]...
I am using an awk command to print a line from a cvs file.the awk command includes an if statement that filter the output-lets say i want to print all the lines that the price field is greater than 30.i have it working when i put the parameters myself.. but when i try to send them with vars it wont work..i am sending the sign of the if statement - can only be: == , < , >it looks like this:
cat file.csv | awk -v sign=">" -v field="2000" '{if($3 sign field) printf "%-12s%-12s%-12s%-12s
",$1,$2,$3,$4}' FS=,
the bold part is the problem , because when i put the sign parameter myself t works great.. i guess its a chars issue but i cant spot it
I having the following awk line in a script, is it possible to modify the script so that it create a the directory if it dosnt exist (similar to mkdir -p) awk -v datum="$DATUM" -v workingdir="$workingdir" '{ sub("\[.*","",$5); print > workingdir"/"datum "/" $5;}' $1
View 1 Replies View RelatedHow to write a shell script the would search for a phone no using at the end text file using sed or awk and store it in a varaible or print it.
The text file is in this form
The first line may take any form but the last line will always be Firstname Lastname:KEN:+254456789
I would like to seach for the Phone and store it in a variable and print it.
The phone no will alway be preceeded by ":+"
Does anyone know how to set up an print-to-file-printer with an alternative system to CUPS? The quality suck on CUPS and there's NO solution, at least i didn't found anyone
View 3 Replies View RelatedI am trying to compare a list of patterns from one file and grep them against another file and print out only the unique patterns. Unfortunately these files are so large that they have yet to run to completion. Here's the command that I used:
Code: grep -L -f file_one.txt file_two.txt > output.output Here's some example data:
Code:
>FQ4HLCS01BMR4N
>FQ4HLCS01BZNV6
>FQ4HLCS01B40PB
>FQ4HLCS01BT43K
>FQ4HLCS01CB736
>FQ4HLCS01BU3UM
>FQ4HLCS01BBIFQ
how to increase efficiency or use another command?
I have a problem when using awk:
e.g: awk '{processing text}' File1 > File2
But when I'm processing the File1, I want to print out some messages to the screen (not the File2). How can I do that?
I have a problem with arrays in awk. What i want is to take some data from a file (ssh log) and print it to a html table. I have managed to print some stuff (user logged in and how many times they have logged in) What i want more is to take all the ip that each user logged in from and print it in a row next to the username and times (in the code i typed blabbla where i want the ip to be shown. How do you think i should approch that, multidimensional arrys maybe?
Code:
I want to get system info like up time, no of process etc. for up time i got the got from net but it is giving me error. i.e.
error:
Following is the code i m using
Code:
Whats wrong with the code?
Using current 32 bit I'm unable to print anything outside of KDE. If I print something from Konqueror or Koffice for instance, my printer shows up in the dialog and everything prints fine. However if I use openoffice or abiword, etc then my only option is to "print to file" It is a samba shared printer that is attached to a 13.1 server, but I don't know that that makes a difference.
View 2 Replies View RelatedI know there is a way to call winapi in runtime in windows. I want to ask how can I call a system call in gcc in runtime (when I don't know what it can be)? I don't mean syscall that I think is for calling only system calls and not library functions.
View 4 Replies View RelatedIts my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.
As an example : I have text file with orders and returns :
Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store
My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)
I'm hoping this is the right category. Is there a terminal command to display what network you're currently connected to?
Example:
My home network's name is (in this example) "home".When connected to it, I want a command that, when run, would give me the output 'home'. Does such a command exist?
I am trying to convert my batch file into a .sh file and i think i have it perfect but it just will not work, so obviously not perfect. This is the code for my batch file.
[Code]....
This works perfectly on my own computer without any problems. I want to host this on my Linux VPS (CentOS 5) and need it to be converted into run.sh. This is the code for my run.sh.
[Code]....
Just installed drivers for Lexmark pro200 - S500 series. However although it is recognised by the system and has a tick by its name, And tells me it is connected via usb file goes to print que but will not print. Also tells me it is Printing - localhost! is this correct?.
View 1 Replies View RelatedIn any case what I'm asking it how can I set PWD into my xTerm title bar. I do NOT want pwd at my command prompt because it would make it too long.
View 2 Replies View Related