typeset -Z4 curtime command is giving different result than expected inside scripts in linux.But it gives expected results outside the scripts.Can you please help us
---------- Post updated at 05:37 AM ---------- Previous update was at 05:25 AM ----------
Last edited by Scott; 08-12-2013 at 10:18 AM..
Reason: Please use code tags
What symptoms do you have? I have pasted your code into AIX and RedHat Linux without issue, but then I have my shell set as ksh. Doing it in bash gives me the following:-
Is this your problem? You don't say, so it's a bit difficult to help.
The same output for me. What do you see? What shell are you using on the two servers? Can you paste the output from:-
I've changed the typeset to set a 4 character field padded with leading zeros, because I was running this at 09:25 local time to me, so the output I got was just 925. On both AIX and RHEL, I am using ksh, but if I swap to bash (the default for RHEL) then I get the following output using typeset -i:-
The -Z flag for typeset is not valid for bash. I've not needed it yet, but it would be good to know of a way to acheive the same effect. When forcing it in, I get:-
Can you paste what you are seeing please, because I don't have a problem with your code, other than not knowing if it is three or four digits.
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Hi All,
Kindly help on the below issue ASAP. Its very urgent.
I have script in which we have below two lines for code and it is not working. Please help.
files_to_process="
abc_*.log
def_*.log
ghi_*.log
"
typeset -A dir_list ${files_to_process}
the script is failing in Linux... (3 Replies)
function fxn
{
echo "target in build_ndm is $target"
}
function main
{
target=${server_type}
echo "target in main is $target"
fxn
}
In the above the value of target is not being propagated to the function while ideally it should be since typeset variables are visible in sub... (2 Replies)
Hi,
As per my understanding typeset wil lmake a variable constant or readonly and -i option will make a variable integer. But please see the below outputs
typeset -i abc=000001;echo $abc
1
typeset -i abc=0000010;echo $abc
8
typeset -i abc=00000100;echo $abc
64
typeset -i... (3 Replies)
typeset -u xname1=$mname1 is working fine in HP-UX.
But it throwing below error in Linux:
line 40: typeset: -u: invalid option
typeset: usage: typeset name .
Please suggest.
Thanks, Ambar (5 Replies)
Hi,
Can any one please explain me the use of 'typeset' in shell scripting?
I donot under stand the use and advantages of using typeset.
In one of our script, it is written like typeset VERBOSE NO_UPDATE
typeset LOAD_SYBASE_TABLES
I donot understand what actually these lines do.
As per my... (2 Replies)
I have found this command *typeset* and the option * -f *, which should provide me the list of all the currently defined functions. Is there any possibility of specifying the file in which this command to search ? (1 Reply)