96,599 reputation
12114239
bio website
location European Union
age
visits member for 2 years, 4 months
seen 29 mins ago

2d
answered Shell expansion and positional parameters
Dec
20
revised Filtering invalid utf8
added 4 characters in body
Dec
20
comment Switch to parent shell without logging out
@nyuszika7h, $$ may be readonly, but IFS is not. Try IFS=0123456789; suspend in ksh for instance.
Dec
20
comment Switch to parent shell without logging out
Note that there's no guarantee that 19 will be the number of SIGTSTP. Use kill -s TSTP or kill -s STOP (TSTP can be trapped or ignored, STOP cannot).
Dec
20
comment Switch to parent shell without logging out
bash does not trap CTRL-Z, when you press CTRL-Z, your terminal emulator sends a ^Z character (0x1a) to the master side of the pty device. The line discipline of the pty driver then sends SIGTSTP to the foreground process group of the terminal. Until then bash is not involved at all. That SIGTSTP may cause the process group leader to suspend and then the wait() that bash does on it will return.
Dec
20
comment Switch to parent shell without logging out
@nyuszika7h, not-quoting variables is the split+glob operator. It makes no sense at all to invoke it here. The behaviour of the split part depends on the current value of $IFS. See also Security implications of forgetting to quote a variable in bash/POSIX shells.
Dec
20
awarded  Necromancer
Dec
19
comment Filtering invalid utf8
Sorry, my bad, the behaviour is unspecified in POSIX since grep is a text utility (only expected to work on text input), so I suppose GNU grep's behaviour is as valid as any here.
Dec
19
answered Filtering invalid utf8
Dec
19
comment Switch to parent shell without logging out
@Mikel, zsh or csh, tcsh, or bash, or the Bourne shell or ksh... (in ksh, suspend is an alias for 'kill -s STOP $$' (note the bug with the missing quotes around $$)).
Dec
19
comment Filtering invalid utf8
The python 2 one fails to flag UTF-8 encoded UTF-16 surrogate non-characters (at least with 2.7.6).
Dec
19
comment Filtering invalid utf8
Except for -a, that's required to work by POSIX. However GNU grep at least fails to spot the UTF-8 encoded UTF-16 surrogate non-characters or codepoints above 0x10FFFF.
Dec
19
revised How was the Shellshock Bash vulnerability found?
deleted 1 character in body
Dec
19
awarded  Revival
Dec
19
comment What is the correct syntax for cloning a ntfs partition to a sparse file on another ntfs drive?
Use ntfsclone which only copies the allocated sectors.
Dec
19
answered How was the Shellshock Bash vulnerability found?
Dec
19
revised mv multiple files same dir without specifying same path or each
added 2 characters in body
Dec
19
comment calendar to check the date and then search 3 months back and add up the days of those months?
Note that that syntax is zsh, not bash. In bash, you need to quote variables and arithmetic expansions.
Dec
19
comment calendar to check the date and then search 3 months back and add up the days of those months?
For GNU date, 3 months ago on 2014-05-31 is 2014-03-03. You'll also be off by one day when across one of the DST shifts in timezones where they apply. For instance, there are 89 days between 2014-02-21 and 2014-05-21, but your solution would report 88 in most timezones that change their clock for daylight saving.
Dec
19
comment calendar to check the date and then search 3 months back and add up the days of those months?
What should the result be on the 31st of May?