9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am trying to find out difference between two dates with Time:Piece. I am able to get the days difference, but I want the Days as wells as hours, mins and sec difference. Below is my code for both, but the later is now working. Can anyone help me out.
With only days
use... (0 Replies)
Discussion started by: sauravrout
0 Replies
2. Programming
while ((numRead = read(inputFd, buf, BUF_SIZE)) > 0)
if (write(outputFd, buf, numRead) != numRead)
fatal("couldn't write whole buffer");
if (numRead == -1)
errExit("read");
if (close(inputFd) == -1)
errExit("close input");
if (close(outputFd) == -1)
errExit("close output");
... (1 Reply)
Discussion started by: fwrlfo
1 Replies
3. Shell Programming and Scripting
Hi,
I am using the following code to retrieve the contents between C-style comments "/* .. */".
perl -lne 'while(/(\/\*.*?\*\/)/g) {print "$1";}'
This works fine when the commented section of code is present in a single line. But I also need to extract the data which is present inside... (3 Replies)
Discussion started by: royalibrahim
3 Replies
4. Shell Programming and Scripting
I am looking for suggestions on how I could possibly optimized that piece of code where most of the time is spend on this script. In a nutshell this is a script that creates an xml file(s) based on certain criteria that will be used by a movie jukebox.
Example of data:
$SORTEDTMP= it is a... (16 Replies)
Discussion started by: snappy46
16 Replies
5. UNIX for Advanced & Expert Users
I often find myself grepping source code for a variable name and many times the name would be present in comment lines that I 'd prefer not to see. Do you guys know any tricks to filter out comments?
Example:
snippet of the source code
/***
* type comment 1
***/
void ... (7 Replies)
Discussion started by: migurus
7 Replies
6. Shell Programming and Scripting
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies
7. Shell Programming and Scripting
hi fndz.
Can you please help me with the code if I call a stored procedure from my shell script and stored procedure returns a cursor,
cursor output should be saved to a file (3 Replies)
Discussion started by: enigma_83
3 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to understand and change some code written by some programmer a while ago. There are following three lines of code that I am unable to grasp. Could anybody please help me understand it?
1) cd - > /dev/null
2) fname=`basename "$1"` where $1 = /dirA/dirB/a.txt
... (3 Replies)
Discussion started by: Vikas Sood
3 Replies
9. Shell Programming and Scripting
use "getopts" to get params from command. Need replace black with a specified string like "%20
DEFAULT_DELIM=%20
...
while getopts dek:f:t:vh OPTION
do
case $OPTION in
t)
DELIM=`tvar=/'"$OPTARG"'/ svar="$DEFAULT_DELIM" awk 'BEGIN{T=ENVIRON;S=ENVIRON; while(index(T,S)!=0){S=S"0"};print... (0 Replies)
Discussion started by: anypager
0 Replies