Reputation
6,932
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
13 27
Newest
 Enlightened
Impact
~711k people reached

  • 0 posts edited
  • 1 helpful flag
  • 474 votes cast
Jun
18
comment Correct locking in shell scripts?
@ClintPachl : Thanks. Interesting reading. I like the solution of using a directory, then creating temp files in that directory, which gets cleaned up automatically.
Apr
16
comment Converting `for file in` to `find` so that my script can apply recursively
IFS is a variable that defines what your field separator value is going to be. The default IFS is usually "whitespace". So spaces, tabs, newlines, etc, will all be recognized as "field separators". Since some movies and songs may be named with spaces in them, this script is saying ignore spaces and tables, and use newlines as the separator. This way, instead or "Terminator 2.mp4" being recognized as 2 movies, "Terminator" and "2.mp4", it's seen as 1 movie "Terminator 2.mp4". Since IFS was saved as OIFS, the end of the script sets that back as the default.
Aug
6
comment Debugging a Solaris network issue
Those port 53 queries you see in netstat -an are just your fileserver trying to do DNS lookups.
Jun
20
comment Script runs manually but not from cron
Sorry. I meant to say a reduced environment. Cron often doesn't run script with the same environment a user would get in an interactive shell.
Jun
19
comment Script runs manually but not from cron
Thanks, @l0b0 . I guess it just looks funny to me. :)
Jun
16
comment Disallow Changing of Passwords
good suggestion! using a VM in this way would provide a good learning environment.
Jun
16
comment Where should I place my websites files with multiple vhosts?
While the answers are correct that it doesn't really matter where you put them, I would offer that /var/www/site1, /var/www/site2 is a widely used convention that will be familiar to many folks, so standardizing there can be beneficial.
Jun
16
comment Disallow Changing of Passwords
There's really no truly functional way, without going down the rabbit hole of all possible commands, since you have to exclude commands you don't want a user to run, rather than having to specifically include commands they are allowed to use. Meaning you have to prevent things like 'sudo bash' followed by 'passwd root', and if you disallow '/bin/bash', you have to catch 'sudo cp /bin/bash /tmp/bash ; sudo /tmp/bash'.
Jun
16
comment Renaming files with its path name
Thanks, @Graeme. Yet another interesting tool I was unfamiliar with. :)
Jun
16
comment Renaming files with its path name
I like this, but only my linux box has prename. Not on the Mac, nor on Solaris. Interesting tool, though, thanks for introducing it to me.
Dec
25
comment How does the piping in this command ultimately achieve to kill the process?
actually xargs will batch the commands into groups of 50 or so, so it runs kill 1 1804, and if there were more than 50 PIDs, it would execute more batches. This is why it can be beneficial to do ls | xarg -iz rm z instead of deleting files one by one.
Dec
25
comment Is there any point in using `sudo` when you are the sole user of your machine?
Also, the use of sudo increases the likelihood that you remain the only user of your computer.
Dec
22
comment Gives access to root user for a period of time
Does the user require root access? Or just elevated privileges for specific tasks? As @Gilles mentioned, once you give someone root, there's really no way to guarantee that you can take it back. You'd be better served putting the effort into designing a role account, or a sudo profile that provides exactly the required privileges, with nothing extra.
Dec
16
comment iSCSI device mapped to different SCSI device
This OP's question wasn't really what I was looking for, but this answer turned out to be the answer I needed. Thank you.
Nov
14
comment Is it possible to find out what program or script created a given file?
Sorry. site got hacked, and was down for a while. new page is at timkennedy.net/2010/12/logging-shell-commands-to-syslog-on.html
Aug
27
comment Solaris 11: Accessing a pool on disk from live DVD?
Glad to hear it. :)
Aug
20
comment How to increase the system CPU load/utilization in Solaris 10 to test nagios?
some solutions are here: stackoverflow.com/questions/2925606/…
Aug
16
comment $PWD variable equivalent of pwd -P
some shells support $(pwd -P) syntax, as opposed to back ticks, but I don't think (t)csh is one (or two) of them. Also, for why you shouldn't script in (t)csh, see: shlomifish.org/open-source/anti/csh
Aug
15
comment Periodically get new lines from file, possibly logrotated
Just use logtail. linux.die.net/man/8/logtail
Aug
15
comment Why can't we execute a list of commands as different user without sudo?
This question was also asked on Superuser, at superuser.com/questions/93385/…, and this answer superuser.com/a/573882/76251 provides a HERE DOC -like method for changing users within a script.