1,694 reputation
27
bio website
location The Netherlands
age
visits member for 1 year, 2 months
seen 12 hours ago

Currently working as system administrator at Bizztravel B.V.. I've earned a bachelor degree in Computer Sciences. Since computing in general is my passion, I try to keep up with the latest development in this field. I'm active on irc.freenode.org and try to contribute to the open source community as much as I can.


Aug
6
comment 'script' session logging makes me exit twice
Camil, the command you had within () will run in a subshell. This means another process is created. Read more about it here: mywiki.wooledge.org/SubShell
Aug
6
answered 'script' session logging makes me exit twice
Aug
6
comment 'script' session logging makes me exit twice
Camil, what does this do: [[ "$(ps -ocommand= -p $PPID | awk '{print $1}')" = script ]] || { script -f /var/log/shellog/$USER-$(date -u +%Y.%m.%d-%H:%M:%S).${HOSTNAME:-$(hostname)}.$$.log && exit ;} I mean, try to put the code within [[ .. ]] keyword and group the command after ||
Aug
6
comment 'script' session logging makes me exit twice
so that will always match. With awk you are printing the first field which is script. Everything after || will never get executed.
Aug
6
comment 'script' session logging makes me exit twice
What does ps -ocommand= -p $PPID return ?
Aug
6
comment SSH Server on Ubuntu not works
@trivelt I'm starting to develop some supernatural abilities. Glad it worked for you.
Aug
6
comment SSH Server on Ubuntu not works
Just to be sure. Do you provide the -p 2222 to the ssh command? Also what does lsof :i 2222 say.
Aug
6
comment Save multiple URL targets to text files
The cat file in a for loop is discouraged. See read builtin. You'd want to use the file as input and iterate over the lines cointained within the file.
Aug
6
answered Save multiple URL targets to text files
Aug
5
comment ssh public key copying
You need to put the password in single quotes. That is '#$something123' If you have a ! in your password then you need to first set +H which denotes histexpand. It would be easier if you can post the output when you run the command.
Aug
5
comment condition && command + exit
@Gnouc nice catch. It will indeed succeed only if there are 3 arguments passed, otherwise it fails.
Aug
5
comment Delete ghost files with special characters
So what if you touch /tmp/newfile or mkdir -p /tmp/newdir Does this work? Is /tmp a seperate partition? blkid or lsblk
Aug
5
comment Delete ghost files with special characters
@FlemmingChristensen can you run chmod -R g+x /tmp and see if that helps? Also update the question and show what ls -ld /tmp does?
Aug
5
comment condition && command + exit
Those are arguments passed to the function f. The { command; exit ; }... runs only if there are less than number of arguments required.
Aug
5
comment Delete ghost files with special characters
It indicates a currepted filesystem. Have you tried rm -rf *.xml ?
Aug
5
comment condition && command + exit
There is more here: mywiki.wooledge.org/BashFAQ/…
Aug
5
answered condition && command + exit
Aug
3
comment Unable to Pull EPEL repository Metadata
I think @garethTheRed is right. After adding the repository you need to initialize it to be able to retrieve packages provided by the repository in quesiton.
Aug
3
comment ssh public key copying
@user3523605 Did you put serv1.com serv2.com in the file and are these lines terminated by a newline? Let's say you put all hosts in the file called hosts.txt If that's the case then the for loop changes slightly. E.g: while read -r host; do ./expt "$host" yourpassword username ~/.ssh/id_rsa.pub; done < hosts.txt
Aug
2
comment ssh public key copying
@user3523605 You need to use the same username + password for all servers. It will not work if destination hosts have different usernames / passwords. It worked in my scenario.