Search Results

Search: Posts Made By: migurus
12,052
Posted By RudiC
In awk, /.../ is (sort of) a regex constant. man...
In awk, /.../ is (sort of) a regex constant. man awk:
So, your expression /$4 ~ "101"/ will try to match exactly this string : $4 ~ "101" - which it won't find in your sample file.
Try
awk -F,...
Forum: Programming 06-13-2019
13,611
Posted By Don Cragun
The standards don't specify how parameters are...
The standards don't specify how parameters are placed on the stack when a function is invoked and any code that assumes that parameters are placed on the stack in the order given (or in the reverse...
Forum: Programming 10-14-2018
4,285
Posted By Don Cragun
Jim basically has it right. With gcc -ansi gcc...
Jim basically has it right. With gcc -ansi gcc is being asked to supply a compilation environment as specified by an ISO C Standard. You will have to look at the gcc documentation to determine...
Forum: Programming 10-14-2018
4,285
Posted By jim mcnamara
__STRICT_ANSI__ macro is defined when you have...
__STRICT_ANSI__ macro is defined when you have the -ansi option set. This turns off some parts of header files that define some functions that before POSIX in 2001 were not necessarily defined in...
2,499
Posted By RudiC
It always pays off to be as specific as possible...
It always pays off to be as specific as possible ("how many oldest files do you need?") and to post OS and find versions so you dont't get advice that doesn't work on your system. Try
find...
Forum: Programming 06-04-2018
3,288
Posted By Corona688
this...
this (https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/) slightly longwinded article...
Forum: Programming 04-30-2018
2,357
Posted By Corona688
if(*cnt == 0) *arr =...
if(*cnt == 0)
*arr = malloc(newsz);
else
**arr = realloc(**arr, newsz); **arr accesses the first element, not the base. Remove one * from these...
3,691
Posted By MadeInGermany
The % character is magic in crontab, one needs...
The % character is magic in crontab, one needs to backslash-escape it.
Within ' ' one needs to put the \% outside, for example
echo 'this is a % sign'must become
echo 'this is a '\%' sign'in...
5,312
Posted By rdrtx1
try adding to cron: 00 00 * * * test $((...
try adding to cron:
00 00 * * * test $(( ($(date +\%s)/24/60/60) \% 45 )) = 0 && /path_to_script/clean_up_script
1,503
Posted By rdrtx1
awk '$0 ~ d {if (e) print e; if (NR>1 && !e)...
awk '$0 ~ d {if (e) print e; if (NR>1 && !e) print ""; printf $0; e=""} $0 !~ d {e=e " " $0} END {print e}' d="^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" infile
2,725
Posted By Aia
Remove the single quotes.
Remove the single quotes.
10,835
Posted By MadeInGermany
Tip: show the last 3 directories in the shell prompt
tcsh: have the following in .cshrc (or .tcshrc)
set prompt="[%C3]: "
zsh: have the following in .zshrc
PS1="[%3C]%# "
bash: have the following in .bashrc
PS1='[${PWD#${PWD%/*/*/*}/}]\$ 'Lacking...
5,465
Posted By Don Cragun
With a Solaris 10 or earlier system, assuming...
With a Solaris 10 or earlier system, assuming that your tar file is named tarfile, the following two step sequence should extract only the directories from your tarfile (by extracting everything...
2,036
Posted By Scrutinizer
You cannot do this with a single basic regular...
You cannot do this with a single basic regular expression. You need to either count the number like some solutions do or use multiple regexes.

A variation on Chubler XL's approach with two...
2,079
Posted By Don Cragun
Hi wisecracker, The command: if ( [ "$a" =...
Hi wisecracker,
The command:
if ( [ "$a" = "A" ] || [ "$a" = "a" ] ) && ( [ "$b" = "B" ] || [ "$b" = "b" ] )
executes [ "$a" = "A" ] || [ "$a" = "a" ] in a subshell environment and if it evaluates...
8,221
Posted By Chubler_XL
This is because you are passing an RE via a...
This is because you are passing an RE via a string, the string is parsed first and one level of escape characters are stripped. Then the result is processed by the RE parser and another level of...
Forum: Programming 06-10-2016
2,358
Posted By Corona688
That bswap is slower then the macro does not mean...
That bswap is slower then the macro does not mean bswap got worse, for all we know, the macro got optimized better, to a degree it exceeded the external bswap. Too many circumstances were changed to...
6,743
Posted By Don Cragun
No. set -o noglob is a synonym for set -f in...
No. set -o noglob is a synonym for set -f in ksh. Both of which disable globing; they are not equivalent to the bash shopt -s nullglob.

If a directory contains files named x.txt and y.txt, the...
6,743
Posted By rovf
I think in ksh it is set -o noglob ...
I think in ksh it is

set -o noglob

The disadvantage of this (and of bash's nullglob) is that the option is turned on until you turn it off explicitly. I suggest that you switch to zsh,...
6,743
Posted By Don Cragun
Some, shells have an option (as an extension to...
Some, shells have an option (as an extension to the standards) that does remove globbing patterns that do not match any existing files. For instance, if you are using a recent bash, the code:
shopt...
Forum: Programming 02-26-2016
3,512
Posted By shamrock
You can convert decimal to binary using...
You can convert decimal to binary using bc...there is no need to write a special C program...
echo "obase=2;1234" | bc
Forum: Programming 02-04-2016
3,725
Posted By Corona688
OK, that was weird. wrap...
OK, that was weird.

wrap *wrap=malloc(sizeof(wrap));

This, folks, is why you don't ever name your variable the same name as a type.

size of structure: 4K and a bit.
size of...
1,291
Posted By Don Cragun
I am not a notepad++ user, but the following...
I am not a notepad++ user, but the following seems to do what you want at the shell prompt level:
awk '
BEGIN { n = split("name position size foregroundColor transparent zPosition", order)
}...
1,388
Posted By Yoda
Try adding a zero to convert:- awk -F\| ' ...
Try adding a zero to convert:-
awk -F\| '
NR == FNR {
A[$1] = $2
next
}
$7+0 in A {
$(NF+1) = A[$7+0]
}
...
9,821
Posted By Aia
In the shell token_search_string='536088|547698'
In the shell
token_search_string='536088|547698'
Showing results 1 to 25 of 66

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