Sponsored Content
Full Discussion: Utime Command
Top Forums Shell Programming and Scripting Utime Command Post 33196 by margue on Thursday 19th of December 2002 10:35:59 AM
Old 12-19-2002
MySQL Great !!

It works great ! Thank you !

But now, I'm facing another problem : when doing ls -ltr filename to obtain the time, I don't have the seconds....
Do you know how to obtain that ?

Thanks.
 

10 More Discussions You Might Find Interesting

1. Programming

equivalent to utime

Hi, Is there any system call which changes the time of symbolic link apart from utime? or if tere is no system call any other option of how to do it? Thanks (4 Replies)
Discussion started by: naan
4 Replies

2. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

3. Shell Programming and Scripting

Cannot utime: Operation not permitted

Hi - I have a script (.ksh) which has been transferred from one Linux box to another. Basically it untars a file a deploys the code to the relevent directories. It is failing with ' Cannot utime: Operation not permitted' When I run the command by hand it *is* doing the untar to the directories... (1 Reply)
Discussion started by: ajcannon
1 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. UNIX for Advanced & Expert Users

unix command : how to insert text at the cursor location via command line?

Hi, Well my title isn't very clear I think. So to understand my goal: I have a script "test1" #!/bin/bash xvkbd -text blabla with xbindkeys, I bind F5 key in order it runs my test1 script So when I press F5, test1 runs. I'm under Emacs/Vi and I press F5 in order to have "blabla" be... (0 Replies)
Discussion started by: xib.be
0 Replies

6. Programming

utime returning -1 BAD File DEscriptor

Hi All, First of all thanks for reading this post. In my application, I am trying to create a new message queue . I am attaching the code below. mqd_t mqopen2(const char * pName, unsigned long Flags, long maxMsg, long msgSz) {... (15 Replies)
Discussion started by: parusasi
15 Replies

7. UNIX for Dummies Questions & Answers

passing command output from one command to the next command in cshell

HI Guys, I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that 1) I need to enter these commands $ echo $DISPLAY $ setenv $DISPLAY output_of_echo_$display_command How can i write a... (2 Replies)
Discussion started by: kaaliakahn
2 Replies

8. Shell Programming and Scripting

SH script, variable built command fails, but works at command line

I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes CC=`which gcc` CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies

9. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

10. UNIX for Beginners Questions & Answers

Another one line command where I'd like to determine if Ubuntu or Red Hat when running command

Hello Forum, I'm making very good progress on my report thanks to the very helpful people on this forum. I've been able to successfully create my report for my Red Hat servers. But I do have a few ubuntu servers in the mix and I'd like to capture some data from them when an ssh connection is... (8 Replies)
Discussion started by: greavette
8 Replies
UTIME(3)						   BSD Library Functions Manual 						  UTIME(3)

NAME
utime -- set file times LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <utime.h> int utime(const char *file, const struct utimbuf *timep); DESCRIPTION
This interface is obsoleted by utimes(2). The utime() function sets the access and modification times of the named file. If timep is NULL, the access and modification times are set to the current time. The calling process must be the owner of the file or have permission to write the file. If timep is non-NULL, time is assumed to be a pointer to a utimbuf structure, as defined in <utime.h>: struct utimbuf { time_t actime; /* Access time */ time_t modtime; /* Modification time */ }; The access time is set to the value of the actime member, and the modification time is set to the value of the modtime member. The times are measured in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970 Coordinated Universal Time (UTC). The calling process must be the owner of the file or be the super-user. In either case, the inode-change-time of the file is set to the current time. RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
utime() will fail if: [EACCES] Search permission is denied for a component of the path prefix; or the times argument is NULL and the effective user ID of the process does not match the owner of the file, and is not the super-user, and write access is denied. [EFAULT] file or times points outside the process's allocated address space. [EINVAL] The pathname contains a character with the high-order bit set. [EIO] An I/O error occurred while reading or writing the affected inode. [ELOOP] Too many symbolic links were encountered in translating the pathname. [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. [ENOENT] The named file does not exist. [ENOTDIR] A component of the path prefix is not a directory. [EPERM] The times argument is not NULL and the calling process's effective user ID does not match the owner of the file and is not the super-user. [EROFS] The file system containing the file is mounted read-only. SEE ALSO
stat(2), utimes(2) STANDARDS
The utime() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''). It was however marked as legacy in the IEEE Std 1003.1-2008 (``POSIX.1'') revision of the standard. HISTORY
A utime() function appeared in Version 7 AT&T UNIX. BSD
April 29, 2010 BSD
All times are GMT -4. The time now is 09:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy