10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
Although I have found similar questions, I could not find advice that could help with our problem.
The issue:
We have a few thousands text files (books).
Each book has many chapters. Each chapter is identified by a cite-key. We need
to split each of those book files by... (4 Replies)
Discussion started by: samask
4 Replies
2. Shell Programming and Scripting
Hi,
Please help me to understand the following code:
perl -lne 'print if "$_ " =~ /(5 (?:\d+ ){5})\1/'
What the regular expression "?:" does?
Also, whether the expression "\1" is the same as in sed (i.e) printing the elements inside pair of parentheses? (3 Replies)
Discussion started by: royalibrahim
3 Replies
3. Programming
Hi,
In the below C code,
#include <stdio.h>
void print() {
printf("Hello\n");
}
int main() {
void (*f)() = (void (*)()) print;
f();
(*f)();
}
I wonder, how the syntaxes "f()" and "(*f)()" are treated as same without any error? Is this an improvement or ANSI/ISO... (1 Reply)
Discussion started by: royalibrahim
1 Replies
4. Shell Programming and Scripting
Hi,
What is the difference in the following two awk one-liners?
awk -F, '{s++} END {if (s == 1 && $4 > "09:10:00") {print $2, $4}}' f1
awk -F, '{s++} s == 1 && $4 > "09:10:00" {print $2, $4}' f1
Even though, all the 2nd column values have duplicate records, the first code does not give any... (4 Replies)
Discussion started by: royalibrahim
4 Replies
5. Shell Programming and Scripting
Anyone please say what is the difference between $var and ${var} in perl
Sometimes $var used and sometimes ${var} used in same program.
Thanks in Advance,
Prabhu
---------- Post updated at 09:34 AM ---------- Previous update was at 05:59 AM ----------
Any one please clarify (1 Reply)
Discussion started by: prsampath
1 Replies
6. Shell Programming and Scripting
Hello ,
Please can someone tell me what exactly happens when the below filehandler is chomped into an array and later mapped.
$lcpLog="logcopy\@".getTimestamp."\log";
open CFg ,"< $lcpcfg";
chomp(@cfg = <CFG>);
close CFG;
@cfg=grep { $_ ne ' ' } map { lc + (split /\s*\/\//) }... (0 Replies)
Discussion started by: rmv
0 Replies
7. Programming
Hi,
I am trying to reverse a string using the following program utilizing the Exclusive OR bit operation:
int main() {
char str = "Quraish";
char *p = str, temp;
char *q = str + strlen(str) - 1;
while ( p != q ) {
if (*p != *q) {
*p ^= *q; *q ^= *p; *p ^= *q;... (1 Reply)
Discussion started by: royalibrahim
1 Replies
8. Shell Programming and Scripting
Dear friends,
I have two files. In first file first column ($1), i have numbers.
The second file containes, the same number in the fourth column($4).
I need a output file, matching the first file column 1 with second file column 4. The main thing is the output file lines will be sorted... (4 Replies)
Discussion started by: vasanth.vadalur
4 Replies
9. UNIX for Dummies Questions & Answers
I have three computers A, B and C. To login to B and C I should use A because it has a SSH key. I don't have any other way of accessing these two computers. Now, if I need to transfer a file between B and C, I am unable to find a way that would work... because I don't know how to authenticate... (1 Reply)
Discussion started by: Legend986
1 Replies
10. Shell Programming and Scripting
hi all
i wrote a shell script which uses perl script my code is :
>cat filename | while read i
>do
>perl -e 'require "/home/scripts/abc.pl" ; abc("$i")'
>done
perl script used will simply check syntax of Cobol programs but it didn't work for me so i asked my colleague he suggested... (1 Reply)
Discussion started by: zedex
1 Replies