83,868 reputation
1092199
bio website
location European Union
age
visits member for 2 years
seen 7 hours ago

8h
comment why do we not need export here?
Depending on the shell, echo $IFS will output NL (where $IFS is a field delimiter (bash, some implementations/versions of ksh or dash) or non-whitespace are not considered different from whitespace (Bourne)) as it's like echo ''. And with others (where $IFS is a field separator (zsh, yash, some versions/implementations of dash or ksh), it will output SPC NL as it's like echo '' ''
9h
comment How to add a carriage return before every newline?
Note that there are several implementations of unix2dos. You may want to give a link to the home page of a specific implementation (like waterlan.home.xs4all.nl/dos2unix.html as found on Debian) instead of linux.die.net/man which doesn't make it clear which implementation (or version) is documented. Note that there are some u2d, ux2dos, todos commands around as well.
9h
comment How to add a carriage return before every newline?
Note that unix2dox won't insert a CR before every LF, only before those LFs that are not already preceded by one (and only one) CR.
10h
comment How do I distribute a large download over multiple computers?
@Marco, seq is not a portable command either. You can use distro001.iso, distro002.iso... distroy010.iso
12h
comment Format ps output without whitespace
That would be the same as tr ' ' ,. You probably want tr -s ' ' , here.
14h
comment How to start XTerm with prompt at the bottom?
@l0b0, probably doesn't deserve a separate answer. I hope celtschk won't mind I edited his/her answer.
17h
comment How to start a process chain from the shell
@lord.garbage, that's not setsid making processes immune to SIGINT (though it does make it immune to CTRL-C by detaching from the terminal). It's running a job in background from a subshell that does. The setsid() system call is the only way one can detach from a terminal.
1d
comment Zsh script how to concatanate array elements with string
word splitting upon parameter expansion doesn't apply to zsh except when emulating other shells (probably the OP is not using zsh though).
1d
comment Zsh script how to concatanate array elements with string
Are you sure your script is being interpreted by zsh. screen -S $sigin"_"$lumarr[lum] would work in zsh.
Aug
28
comment rename a list of files according to a text file
ls | paste - /the/text/file | xargs -n2 mv
Aug
28
comment Replace specified character between two strings?
@kemaro, I won't have time to provide with an explanation, but I've made it a community wiki answer, so maybe someone will step in and add an explanation.
Aug
28
comment Replace specified character between two strings?
@Gnouc, probably reminds me of my first computer (Amstrad CPC464) where I did my first programming on locomotive basic.
Aug
28
comment Why might debian become unresponsive with virtually 0% CPU usage?
ifconfig. Are there up interfaces? netstat -rn. Can you ping your default router. traceroute to something? tcpdump -ni any and see if there's any network traffic.
Aug
28
comment How to start a process chain from the shell
Sorry setsid bash -c 'firefox; exit' if you actually want init -- bash -- firefox not connected to a terminal (setsid sh -c 'bash -c "firefox; exit" &' to make sure that bash doesn't get control of a terminal if it ever opens one).
Aug
28
comment How to start a process chain from the shell
And unix.stackexchange.com/a/56510/22565
Aug
28
comment How to start a process chain from the shell
See also unix.stackexchange.com/q/68574/22565
Aug
28
comment Why might debian become unresponsive with virtually 0% CPU usage?
The only symptoms you seem to be mentioning is that the network is down. I'd start looking at that.
Aug
28
comment How to start a process chain from the shell
Try setsid sh -c 'firefox&' <> /dev/null >&0 2>&0 (note that it makes it immune to SIGINTs)
Aug
28
comment Why does each process folder under /proc contain the same information?
They wouldn't if they were running in a different network namespace (like in containers or if you use ip netns).
Aug
28
comment Can find work more efficiently to delete a large number of old files?
That calls one rm per file. rm accepts more than one file as argument, so -exec rm -rfv {} + is going to be a lot faster.