Search Results

Search: Posts Made By: alex_5161
3,817
Posted By RudiC
Yes, but: fl[0-9] (called "Pathname Expansion /...
Yes, but:
fl[0-9] (called "Pathname Expansion / Pattern Matching") expands to EXISTING files that match the pattern, fl{0..9} (called "Brace Expansion") yields all strings unconditionally:
echo...
3,817
Posted By Aia
They are a couple examples of ways you could call...
They are a couple examples of ways you could call multiple files (even more than just two) at the command line, courtesy of the shell, without writing one by one.

fl[0-9] would expand to fl0 fl1...
3,817
Posted By Aia
perl -ne '$.=1 if $ARGV ne $previous; print "$....
perl -ne '$.=1 if $ARGV ne $previous; print "$. in $ARGV: $_" if /\d\d/; $previous=$ARGV' fl[0-9] fl1{0..9}

while (<>) {...}
Read from file(s) given at the command line or from stdin if no file...
Forum: Programming 10-13-2016
48,453
Posted By jim mcnamara
Here is sample code using dup() and dup2()- I...
Here is sample code using dup() and dup2()- I copied this from somewhere years ago:

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc, const...
3,025
Posted By Aia
(?:^[^\r\n\{]*;?[\s]+){0,10} (){0,10} # a...
(?:^[^\r\n\{]*;?[\s]+){0,10}
(){0,10} # a grouping that could repeat from 0 to 10 times max
?: # do not capture this group (do not save in memory to use later)
^ # match start of the line...
Forum: Programming 09-07-2012
3,180
Posted By Corona688
Unfortunately I must disagree. For your...
Unfortunately I must disagree. For your purposes, they amount to #define's without the mess. They don't vanish in precompilation, but they do vanish in a later phase of compilation, values set and ...
Forum: Programming 09-07-2012
3,180
Posted By Corona688
Designated inits in gcc actually work with enums!...
Designated inits in gcc actually work with enums! This might give you something close to what you wanted...

#include <stdio.h>

enum { A, B, C };
enum { D=5, E, F };

const int lookup[256]={...
Forum: Programming 09-07-2012
3,180
Posted By Corona688
Because 1 isn't 0? :confused: enums are just...
Because 1 isn't 0? :confused: enums are just integers, their definitions don't change the laws of mathematics.

I think you might be confused about what an enum is. They're integers, pure and...
2,805
Posted By reshkraj
Thanks Anchal. I am using write_row() after...
Thanks Anchal. I am using write_row() after getting the row from the database . In the complete worksheet I have several columns which I need as integers. Is there a way I can make particular column...
1,624
Posted By yazu
Only two things I can suggest: 1. IFS variable...
Only two things I can suggest:
1. IFS variable was changed somehow.
2. It's zsh shell.
6,886
Posted By Perderabo
Try this:#!/bin/csh -f echo " -- starting $0...
Try this:#!/bin/csh -f
echo " -- starting $0 --"
echo " .. before executing bash-code : "

/bin/bash <<"#END"
pair=123-456
aRID=${pair%-*}
iRID=${pair#*-}
echo " aRID=$aRID;...
2,770
Posted By Perderabo
How about this:$ perl -de 0 Loading DB...
How about this:$ perl -de 0

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1): 0
...
Forum: Programming 06-22-2010
1,593
Posted By Praveen_218
You'd also be interested in exploring cpp ; Its...
You'd also be interested in exploring cpp ; Its the C pre Processor , available on most UNIX systems. However, I have used it mostly on my Linux ststems only ;)

Just run the command:

$ cpp...
Forum: Programming 06-22-2010
1,593
Posted By shamrock
You need the "-P" switch which stops acc after...
You need the "-P" switch which stops acc after the preprocessing stage and produces a file with the same prefix as the source filename but with a ".i" extension.
Forum: Programming 06-21-2010
1,593
Posted By JohnGraham
Pass the `-E' flag to gcc, which tells gcc to...
Pass the `-E' flag to gcc, which tells gcc to stop after the preprocessing stage. You should probably use a .i file extension (e.g. `gcc program.c -E -o program.i') since that's the standard for C...
11,628
Posted By alister
There are a few things wrong. You aren't...
There are a few things wrong.

You aren't declaring main() to return an int, although the compiler is probably taking care of this for you.

main() is not returning a value.

rt is not the...
11,628
Posted By DoxieLvr
First, you need to read the man page on...
First, you need to read the man page on system(3). The return value is of the format returned by wait(2). Thus, you need to feed that into the WEXITSTATUS macro to get the actual return value.
...
100,859
Posted By EAGL€
I am using the below script in a production...
I am using the below script in a production machine in a backup script and it works pretty well, on 1st of Jan and 1st of March (leap years) it works correctly, considers leap year well, try it

#!...
Forum: UNIX and Linux Applications 07-28-2008
8,224
Posted By quine
It's real DATA ANALYSIS! Why are you using...
It's real DATA ANALYSIS!

Why are you using "ls -l" if all you want is the names? Try ls -1.. That will simplify things for you... As for the special characters, get used to "od" Octal Dump.......
55,726
Posted By ennstate
Using exec & pipe
Hi,
I managed to get that working using exec & pipes.The following is the script which i hope to work for you as well,

#!/bin/bash
#Objective : To redirect the stdout & stderr to two different...
139,673
Posted By grial
Helo. sed 's/^M//g' input_file > output_file...
Helo.

sed 's/^M//g' input_file > output_file

will do the job, but to get the "correct" "^M" use:
"control+v" followed by "control+m" key combinations.

Regards.
139,673
Posted By Krispy
Thanks for the swift response guys - much...
Thanks for the swift response guys - much appreciated.

Thestevew was right - I was misunderstanding the vi 'set list' option, so thanks for putting me straight.

I eventually came up with a...
139,673
Posted By Hitori
in vi you can replace all ^M characters with...
in vi you can replace all ^M characters with command
:%s/^M//g

(Note that to type ^M in vi type Ctrl-V Enter)

I realise that this note may be offensive for vi users :)
401,409
Posted By Perderabo
In vi, use :set list and you can do :set...
In vi, use
:set list
and you can do
:set nolist
to get back to normal.
Showing results 1 to 24 of 24

 
All times are GMT -4. The time now is 10:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy