Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Search Forums

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Showing results 1 to 8 of 8
Search took 0.00 seconds.
Search: Posts Made By: cfajohnson
Forum: Programming/Scripts 28th September 2009, 02:29
Replies: 3
Views: 6,743
Posted By cfajohnson
Do the images not have an alt text that you could...

Do the images not have an alt text that you could use?
Forum: Programming/Scripts 21st April 2009, 04:16
Replies: 1
Views: 4,250
Posted By cfajohnson
Use awk, not sed: awk ' BEGIN {...

Use awk, not sed:


awk '
BEGIN { filename = "/dev/null" }
/^OBJECT/ { filename = $2 "_" $3 }
{ print > filename }
' "$FILE"
Forum: Programming/Scripts 1st August 2007, 03:36
Replies: 3
Views: 3,634
Posted By cfajohnson
It might not be any faster, but try this: ...

It might not be any faster, but try this:


locate '/usr/file_manager_2007/*' |
while read file
do
[ -f "$file" ] && setfacl -m g:directors:rwx "$file"
done
Forum: Programming/Scripts 1st August 2007, 03:32
Replies: 1
Views: 5,507
Posted By cfajohnson
Use patch, not sed. However, if you just...

Use patch, not sed.

However, if you just want file1 to be the same as file2, why not copy file2 to file1?
Forum: Programming/Scripts 25th April 2007, 14:31
Replies: 7
Views: 5,370
Posted By cfajohnson
for i in `echo $*` is an inefficient way of...

for i in `echo $*` is an inefficient way of writing for i in $*, which will break any arguments on whitespace (or whatever is contained in $IFS).

For example, compare these two functions:

...
Forum: Programming/Scripts 25th April 2007, 00:57
Replies: 7
Views: 5,370
Posted By cfajohnson
Because I misread `echo $*` as `echo *`. Let...

Because I misread `echo $*` as `echo *`.

Let me rephrase it:

That is an unsafe way to operate on a list of parameters. Use:


for i in "$@"
do
Forum: Programming/Scripts 24th April 2007, 00:06
Replies: 7
Views: 5,370
Posted By cfajohnson
That is an unsafe way to operate on a list of...

That is an unsafe way to operate on a list of files. Use:


for i in *
do



var=`printf "%s\n" "$i" | tr '[a-z]' '[A-Z]'`
val=`which $WFU "$i"` || continue
Forum: Programming/Scripts 19th April 2007, 18:13
Replies: 3
Views: 3,987
Posted By cfajohnson
Most of what you are doing can be done with...

Most of what you are doing can be done with useradd itself. Read the man page.

The (moderately) tricky part is encrypting the password. I use a compiled C program as a front end to crypt(3):
...
Showing results 1 to 8 of 8

 
Forum Jump

All times are GMT +2. The time now is 16:16.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.