Sorry! ;-)) Of course it is meaningful. I was thinking about the scripts i was writing and couldn't find a single one without any external program. You are correct in pointing out datecalc to me, because things like this (which are quite "abstracted" from concrete problems) i have put into external ksh functions and use these so frequently that i don't think about how they are constructed. I shouldn't have looked into my scripts but my functions. Anyway, i stand corrected and offer my apologies.
Quote:
When I get some time I'll benchmark rot13 in pure ksh vs tr.
I have done that and this was the real surprise for me. Here are the scripts i used (yes, i used ksh93. In AIX the default shell is ksh88 still, but i didn't want to reinvent the substring function of ksh93):
The the "external" version is "xtime1.sh", the "shell-only" version xtime2.sh:
I reasoned that the tr command has to be executed completely while the long case..esac construct is not completely used because i used characters from the beginning of the alphabet. So changed "$var" above to the complete alphabet and ran again:
You see that the length of the string indeed has some impact but not nearly as much as i would have expected. The tr-version was not impacted by the length of the string, because the most expensive part is the call of tr itself and the work it does is negligeable by comparison.
So also in this case i stand corrected. I heavily understimated the "cost" of system calls and would have supposed that - because the implementation is way longer - there would be a tradeoff. Obviously this is not nearly the case.
Anyway, it was interesting to find out all this and i am glad i still can learn something about shell programming every day. ;-))
Hi,
I am new to this forum and unix too. I have just started learning unix. As I was going through the first chapter, I read that unix is multitasking, multiprogramming, multiprocessing and multiuser OS.
My question is: Is there any difference between a TASK and a PROCESS. How are PROCESS... (2 Replies)
I have a file contains
TASK gsnmpproxy {
CommandLine = $SMCHOME/bin/gsnmpProxy.exe
}
TASK gsnmpdbgui {
CommandLine = $SMCHOME/bin/gsnmpdbgui.exe
I would like to comment and than uncomment specific task eg TASK gsnmpproxy
Pls suggest how to do in shell script (9 Replies)
I have an task definition listing xml file that contains a list of tasks such as
<TASKLIST
<TASK definition="Completion date" id="Taskname1" Some other
<CODE name="Code12"
<Parameter pname="Dog" input="5.6" units="feet" etc /Parameter>
<Parameter... (3 Replies)
believe it or not but this is my first c program (i've worked with java, C#, php though) I am trying to make a daemon that checks if mplayer is running(it's for a projection room) and if it is not then to run mplayer with a file.. So far it's not working and I don't know why
Help and comments... (5 Replies)
Hello,
I have kubuntu on my laptop and now I decided to switch to Windows 7. I made the bios settings properly (first choice is boot from cd\vd) but I see the error
" reboot and select proper Boot device or insert Boot media in select Boot device and press a key "
I have tried CD and... (0 Replies)
Hi all,
I'm newbie and stuck here. Thanks for any help.
Input(txt file)
a b X
c d Y
e f Z
g h W
Requested output:
a b X Y
c d Y X
e f Z W
g h W Z
Please use code tags when posting data and code samples! (10 Replies)
Hi experts,
I have a problem with the below shell task:
I need to modify the file creatin a paired row , per each row
which matches filter (e.g. number of nonempty columns = 5)
Output should look like this:
second row is original one from the input,
first row(red) is pairing row, it's... (29 Replies)
I have a simple task for my school work. I'm new with unix, so i need help.
I need to write a scenario. Task is. From created txt file read first 3 words and create a 3 catalogs with those 3 words. 2 of those new catalogs should be transferred to other directory. If someone could help me just... (1 Reply)