Sponsored Content
Top Forums Shell Programming and Scripting [ksh] at -f at.file now not working on Solaris. Post 302536269 by hergp on Tuesday 5th of July 2011 02:19:11 AM
Old 07-05-2011
Try to unset $DATEMSK and try again. There seems to be a problem with this environment variable.
This User Gave Thanks to hergp For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ls not working as expected within ksh

Hi, I use the command ls a\b\c\*.txt from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory When embeded in a ksh script `ls a\b\c\*.txt` it does not work - I get *.txt not found (even though there are files) I tried... (10 Replies)
Discussion started by: GNMIKE
10 Replies

2. AIX

Substitution not working in ksh

Following code is working in bash but not in ksh. Can someone please send me an alternative? #!/bin/ksh fname="EOA.dmp" echo $fname logname=${fname/.dmp/.log} echo $logname I am getting below error in ksh "testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution is not... (2 Replies)
Discussion started by: arsheshadri
2 Replies

3. Solaris

Substitution not working in ksh

Hi, Following code is working in bash but not in ksh. Can someone please send me an alternative? #!/bin/ksh fname="EOA.dmp" echo $fname logname=${fname/.dmp/.log} echo $logname I am getting below error in ksh "testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Discussion started by: arsheshadri
3 Replies

4. AIX

du not working for user using ksh

Hi, I have a strange problem with a AIX server, user are having problem with using du will in their ksh shell, if they switch to sh or bash there is not problem. root account that are using ksh but have not problem with du. this is the error messages when trying to run du du: can't find... (5 Replies)
Discussion started by: robertngo
5 Replies

5. Shell Programming and Scripting

Solaris KSH shell script to copy all lines from one file to another

Hello, more of a windows wscript guy. However I took a new position that requires me to support some solaris servers. So... issue is that I need to copy all lines from a file to a temporary file and then copy them back into the original file starting at line 1. Reason I need to do this is... (5 Replies)
Discussion started by: ZigZaggin
5 Replies

6. Shell Programming and Scripting

If statement is not working in KSH

#! /bin/ksh rm -f ./xyz file --- this line is working // Below any if stmt is not working. if then echo " blah blah " fi or I replaced above if with if then echo "dir exists" fi This is also not working. I am new to KSH. So can someone help why if stmt is not... (31 Replies)
Discussion started by: saggy9583
31 Replies

7. Shell Programming and Scripting

File name auto completion not working in KSH.Please help

Hi All, I am using SunOS 5.8 verison with KSH shell. My problem is I am not getting auto completion of file name on pressing of TAB or ESC key. While pressing ESC key , '^[' is getting printed . TAB is printing doin nothin but jus printing tab. What should I do to get auto completion of... (3 Replies)
Discussion started by: Sooraj_Linux
3 Replies

8. Shell Programming and Scripting

ksh script not working

Here's the script: #!/usr/bin/ksh Date=`date +%m%d%y` CDate=`date` FileName=cintas_hosts_and_users.$Date echo $CDate >> $FileName #echo $FileName for host in `cat /collect/itthomp/cintas_hostnames.dat` do echo $host >> $FileName ssh $host "awk -v Fname=$FileName -F: '{if($1 != "root"... (3 Replies)
Discussion started by: jgt157
3 Replies

9. Shell Programming and Scripting

Working with FOR in ksh 88

Hi, I tried the following but giving me all the files in the directory , Where i need the files which are assigned to variable like below #!/bin/ksh Src_Dir="/home/etc" file_nm ="ab.temp" for File in `ls $Src_Dir/$file_nm*` do File=`basename $File` echo $File ... (2 Replies)
Discussion started by: smile689
2 Replies

10. Shell Programming and Scripting

Script not working with ksh

Hi I am not able to execute a script with ksh. Its not giving any error too. I have tried with absolute path /usr/bin/ksh test.sh . Also checked path variable and all looks fine It runs fine with sh. OS is solaris 10. (9 Replies)
Discussion started by: ningy
9 Replies
GETDATE(3)						     Linux Programmer's Manual							GETDATE(3)

NAME
getdate() - convert a string to struct tm SYNOPSIS
#define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED #include <time.h> struct tm *getdate (const char *string); extern int getdate_err; #define _GNU_SOURCE #include <time.h> int getdate_r (const char *string, struct tm *res); DESCRIPTION
The function getdate() converts a string pointed to by string into the tm structure that it returns. This tm structure may be found in static storage, so that it will be overwritten by the next call. In contrast to strptime(3), (which has a format argument), getdate() uses the formats found in the file of which the full path name is given in the environment variable DATEMSK. The first line in the file that matches the given input string is used for the conversion. The matching is done case insensitively. Superfluous whitespace, either in the pattern or in the string to be converted, is ignored. The conversion specifications that a pattern can contain are those given for strptime(3). One more conversion specification is accepted: %Z Timezone name. When %Z is given, the value to be returned is initialised to the broken-down time corresponding to the current time in the given time zone. Otherwise, it is initialised to the broken-down time corresponding to the current local time. When only the weekday is given, the day is taken to be the first such day on or after today. When only the month is given (and no year), the month is taken to be the first such month equal to or after the current month. If no day is given, it is the first day of the month. When no hour, minute and second are given, the current hour, minute and second are taken. If no date is given, but we know the hour, then that hour is taken to be the first such hour equal to or after the current hour. RETURN VALUE
When successful, this function returns a pointer to a struct tm. Otherwise, it returns NULL and sets the global variable getdate_err. Changes to errno are unspecified. The following values for getdate_err are defined: 1 The DATEMSK environment variable is null or undefined. 2 The template file cannot be opened for reading. 3 Failed to get file status information. 4 The template file is not a regular file. 5 An error is encountered while reading the template file. 6 Memory allocation failed (not enough memory available). 7 There is no line in the file that matches the input. 8 Invalid input specification. NOTES
Since getdate() is not reentrant because of the use of getdate_err and the static buffer to return the result in, glibc provides a thread- safe variant. The functionality is the same. The result is returned in the buffer pointed to by res and in case of an error the return value is nonzero with the same values as given above for getdate_err. The POSIX 1003.1-2001 specification for strptime() contains conversion specifications using the %E or %O modifier, while such specifica- tions are not given for getdate(). The glibc implementation implements getdate() using strptime() so that automatically precisely the same conversions are supported by both. The glibc implementation does not support the %Z conversion specification. ENVIRONMENT
DATEMSK File containing format patterns. TZ, LC_TIME Variables used by strptime(). CONFORMING TO
ISO 9899, POSIX 1003.1-2001 SEE ALSO
localtime(3), strftime(3), strptime(3), time(3) 2001-12-26 GETDATE(3)
All times are GMT -4. The time now is 02:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy