Reputation
3,082
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
6 20
Impact
~212k people reached

Aug
13
comment Fill empty lines in specific column with values
It seems like you are trying to run kill -9 pid which is wrong. Use kill -l to see all available signals en what you need to use instead.
Jul
2
comment How to get back my splitted screen after I lost connection with “screen”
unfortunately splits in screen do not persist after a connection loss or deliberately detach.
Jul
2
comment Print alternating lines with conditional
uniq can read files as well. uniq -f1 filename will work just fine
Jul
2
comment Using cron to start a process on a terminal without using screen?
You can use something like * * * * * echo test >/dev/pts/2 where 2 is the terminal you have active. Use w to see details.
Jun
22
comment RPM installation %post macro works on terminal but not on GUI
@AvinashNair use the snippet in my answer and see if this changes anything.
Jun
11
comment RPM installation %post macro works on terminal but not on GUI
@AvinashNair Ok, so what does echo "$DISPLAY" tell you prior building the rpm? Try then su -c 'rpm -ivh sample_rpm' and tell me what you get.
Jun
10
comment Determine the target of an SSH connection at runtime
See man ssh_config
May
26
comment BASH: Fifo troubles - seems selective about input
In the writer part you are using FD 4 so you are doing: done 4>"$fifoIn" Should be done 4<"$fifoIn" Also fifoIn=$(mkfifo /path/to/fifo). You need to make sure fifo exists. Then.. use while IFS= read -r line; do printf '%s\n' "$line"; done ... As Anthony suggested, use set -xv just under the shebang so you get more debugging info
May
24
comment grep command not working in conditional statement
And now I'm confused as well.
May
23
comment How can I partially copy a file from a broken disk?
Another option is to use e.g split -b[bytes] yourbigFile
May
21
comment CentOS can't remove user from group
No idea why this answer has not been upvoted. It's best practice!
May
19
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.
May
19
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
May
19
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.
May
19
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
May
19
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
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
8
comment how to check directory is empty
See mywiki.wooledge.org/BashFAQ/004
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