Reputation
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
4 19
Newest
 Nice Answer
Impact
~153k people reached

12h
comment CentOS can't remove user from group
No idea why this answer has not been upvoted. It's best practice!
1d
revised Add extension for multiple files, based on their types
Surpress output if some files already have an extension and those who already have an extension don't add the extension.
2d
comment How can I copy a file in a bash script and rename it while copying and place it in the same directory
@StéphaneChazelas that is even shorter indeed. Good to know.
2d
comment Nginx init.d script
@SanderKoenders did you check if the pid file aready exists? Also on what port is nginx listening? Are you using nginx with php-fpm? what does lsof -i :[nginxportnr] tell you. See also netstat -tanulp what it reports. You could try to run nginx with strace
2d
revised How can I copy a file in a bash script and rename it while copying and place it in the same directory
added 73 characters in body
2d
comment How can I copy a file in a bash script and rename it while copying and place it in the same directory
@StéphaneChazelas You've a point there. I should have used -- to indicate end of options. Well the .doc suggests a file. That check is not necessarily either.
2d
comment How can I copy a file in a bash script and rename it while copying and place it in the same directory
That's not what OP asked either. What it does is just copy source file to dest file. There is a shorter step though. cp /path/to/dir/{file.doc,file_copy.doc} Again, the OP wan'ts to use the positional parameter $1
2d
answered How can I copy a file in a bash script and rename it while copying and place it in the same directory
2d
comment shell scripting remote commands through ssh
@RatDon as a quick workaround you can e.g use: ctrl+z which will send a SIGTSTP to the process. Here after you can enter bg and there you go!
May
19
answered Searching file in a directory through bash script
May
18
comment Service start fails after Capistrano2 deploy task
Please quote every expansion e.g "$PIDFILE". Don't use CAPITAL letters for normal variable names. Also use $(...) command substitution instead. Put set -x just beneath your #!/bin/sh and see if the var "$PIDFILE" is set.
May
14
comment Fedora 21 internet is very slow
Can you check your interface settings? eg using ethtool or mii-tool as in mii-tool -v [ifacename] Check mtu? etc..
May
8
comment how to check directory is empty
See mywiki.wooledge.org/BashFAQ/004
May
8
reviewed Approve How can I use CNAME in Bind properly?
May
8
reviewed Approve How does the iptables work with IPv6?
May
8
reviewed Approve Not able to install modules p5-Expect, P5-IO-Tty, p5-IO-Stty, p5-Digest-MD5, p5-YAML in FreeBSD 10
May
7
comment How does the iptables work with IPv6?
@blackcornail Not sure if you or anyone else noticed. You've a syntax error there in your start) section. iptables -nat -A ... should be iptables -t nat -A ...
May
6
comment bash - change filename in a loop
@CarlH basename(1) can strip the directory and extension from a path (directory/subdirectory/filename.extension -> filename.extension or filename). A parameter expansion can do it cleaner and much faster: "${path##*/}", "${path%.*}", at the cost of missing corner cases like path=/ For more see: mywiki.wooledge.org/BashFAQ/100?highlight=%28basename%29
May
6
awarded  Nice Answer
May
6
comment bash - change filename in a loop
oh really, I hope you are not serious. Quotes are crusial in bash for the above mentioned reasons. touch "file with spaces"; var="file with spaces"; cat $var && cat "$var" Notice the difference. In this case I'm using cat but imagine if one used rm. This will have very bad side effects. Avoid it if unnecessary! is just a bad advice.