Reputation
1,870
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
4 10
Newest
 Civic Duty
Impact
~141k people reached

Apr
20
comment Echo command with AND operator doesn't exit
0 means true. && means : execute the next instructions if and ony if the preceding one was true. therefore what you see is normal.
Apr
13
comment bash execute command for X arguments at a time
+1 but i'd also recommend to do this directly on the remote system using its crontab (if any) or another kind of robust session (screen?). not through a ssh session (or, if through ssh, via a "screen" session, if available on the remote host). ie, anything that will survive a disconnection
Apr
10
comment List all files / binaries in current PATH
I m glad it helped :)
Mar
25
awarded  Civic Duty
Mar
19
comment Why do many commands provide a “quiet” option?
@StéphaneChazelas: you'd be amazed how (parts of) many systems are still that old... (well, actually, not that many ^^ but there are still some)
Mar
16
comment remove ^M from solaris by perl one liner on the same file
what @StéphaneChazelas means at the end of his comment is that the ^M shown there is 1 (special) caracter, displayed as ^M in vi (or with cat -v), but entered with: ctrl + v ctrl + m
Mar
13
comment Date computations without GNU tools
a case .... should always contain the default case, such as for example *) output_error ; exit 1 ;; . Here, any timezone different than one of your 3 cases will be silently ignored.
Mar
11
comment Showing all pages at once with man command
+1, DNUUOC (Definitely Not Useless Use Of Cat)
Mar
10
comment How to read dash files
the recommended way is actually to use ./ prefix. It's the most portable (cf the usenet era's Unix FAQ)
Mar
10
comment /usr/bin/awk: Argument list too long
@brucezepplin : then $ line1 is too big. you can add a "-n 10" arg to xargs, so it breaks the input in 10 arguments chunk, and execute awk ... with these 10 args at the end. But i believe here xargs is not what you want : it changes completely the awk behaviour: instead of feeding awk's stdin, xargs will put the incoming stdin as arguments at the end of the awk command line ! please describe what you try to achieve
Mar
10
answered Is it possible to reverse a command in the bash shell?
Mar
10
comment Is it possible to reverse a command in the bash shell?
to undo the shutdown, see here : stackoverflow.com/a/526330
Mar
10
comment /usr/bin/awk: Argument list too long
@brucezepplin the idea would be to do it all from within awk (which can neatly emulate sed and grep). the only caveat would be if you need the external (= shell level) variables later, in which case you should continue as you are trying to do. where is the xargs, by the way?
Mar
10
comment How can I use a wildcard to match just files, not directories?
+1 for portability (there are a lot of very old systems out there!)
Mar
10
comment Replace \n with blank in a file
so far you have the only correct answer. +1. if i nitpick a bit, I'd add a $ after the n, if you only want to delete the \n that are at the end of each line
Mar
10
comment /usr/bin/awk: Argument list too long
you can pass the filename to awk, and read if from within awk to value awk's vars, instead of passing the values via shell variables. less size limitations that way.
Feb
2
comment How to move all files inside present subfolders up here
please note that this is GNU mv's option, and not available on every unices (in some production environment, at least). I provide a more portable solution, but yours works fine for Linux
Feb
2
comment How to move all files inside present subfolders up here
@Costas: the OP mention there are so many files that "*" can't be expanded ... Here I just expand the 50 folders names, and the rest is handled by xargs
Feb
2
revised How to move all files inside present subfolders up here
edited body
Feb
2
answered How to move all files inside present subfolders up here