Search Results

Search: Posts Made By: Gee-Money
1,669
Posted By Gee-Money
you can use sed search and replace to just print...
you can use sed search and replace to just print the match, you just have to put the pattern in parentheses, and then reference the match in the replace part with a \1

pwd | sed...
1,869
Posted By Gee-Money
you seem to know some perl, so why are you...
you seem to know some perl, so why are you leaving out the semi-colons?

As a general rule of thumb, you need one after pretty much everything.
Forum: AIX 07-06-2009
45,109
Posted By Gee-Money
Any variable in the shell comes into existence by...
Any variable in the shell comes into existence by your shell's startup scripts...

I would start there. Not sure about ksh, but in bash it would be /etc/bashrc....start there, and that file should...
48,604
Posted By Gee-Money
off the top of my head, this should work: ...
off the top of my head, this should work:

machine=`echo $hostname | awk -F'-' '{print $1}'`
group=`echo $hostname | awk -F'-' '{print $2}'`
building=`echo $hostname | awk -F'-' '{print $3}' |...
1,927
Posted By Gee-Money
From the output of: # help set ... -x ...
From the output of:

# help set
...
-x Print commands and their arguments as they are executed.
...


so just put "set -x" at the top of the script before any other commands.

A much more...
8,726
Posted By Gee-Money
Insert is not "-i". It's just "i". Do not confuse...
Insert is not "-i". It's just "i". Do not confuse sed "commands" with command line options. The command line option "-i" means to edit the file in place (dangerous!) in most sed versions that have...
1,614
Posted By Gee-Money
"next" in awk means "stop processing the current...
"next" in awk means "stop processing the current line, and move onto the next line, starting at the top".

Don't confuse "next" with "getline".

"~" (tilde) is for a regular expression...
4,494
Posted By Gee-Money
What exactly do you mean by "open the script"? ...
What exactly do you mean by "open the script"?

Reading the script, or executing it?
2,969
Posted By Gee-Money
You're welcome. I'm glad that I could assist.
You're welcome. I'm glad that I could assist.
20,620
Posted By Gee-Money
using command substitution: $(some command) ...
using command substitution:

$(some command)

is NOT how you call non-awk commands from awk.

What you want to do can be achieved with a little awk magic....just awk.
...
2,969
Posted By Gee-Money
I just wrote this amazing script. Check it: ...
I just wrote this amazing script.

Check it:
ls /some/directory

OR, for the long listing:
ls -l /some/directory

OR, for the current directory:
ls

ORRR, for a long listing of the current...
1,316
Posted By Gee-Money
First off, you should post ALL of the code, not...
First off, you should post ALL of the code, not just a snippet of the until loop. Based on your post, I have no clue what "$line" is.

Second, please use the code box/tags for your code...thats the...
Forum: AIX 06-10-2009
2,434
Posted By Gee-Money
well, this type of situation can depend on...
well, this type of situation can depend on several factors..

do the "sudoers" all have full permission? if so then just make the script owned and executable by root only

otherwise you could...
4,723
Posted By Gee-Money
Whipped this up...fun stuff, i'll leave the...
Whipped this up...fun stuff, i'll leave the output formatting up to you

i created a file with your top input:
$ cat file
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE ...
1,440
Posted By Gee-Money
for one thing, to get a list of files to loops...
for one thing, to get a list of files to loops through, it would have to be something like this:

for file in `ls -1 $InputDirectory/*.shp`;
do
something with $file
done

The way you had...
2,337
Posted By Gee-Money
if [ '/usr/bin/egrep "$kky2" $FL2' ] ; then ...
if [ '/usr/bin/egrep "$kky2" $FL2' ] ; then

this will always be true because it is just a single quoted string in a test bracket. A string is always true.

maybe try something like this:
...
21,839
Posted By Gee-Money
From the grep man page: -o, --only-matching ...
From the grep man page:

-o, --only-matching
Show only the part of a matching line that matches PATTERN.


In the words of the Kool-Aid guy....Ohhh-Yeeeaah!
Forum: Web Development 05-17-2009
9,068
Posted By Gee-Money
This is some straight up homework. No one in...
This is some straight up homework. No one in their right mind is making a username and password glenn/glenn.

I am a part time Linux instructor, and this is the type of stuff i would have my...
21,978
Posted By Gee-Money
Just to clarify what ghostdog said...this...
Just to clarify what ghostdog said...this "startswith" business is whats known as a "string method", and in string methods (there are many), it uses strings, not regular expressions.

The only way...
13,063
Posted By Gee-Money
I don't think you can set "?" For one thing,...
I don't think you can set "?"

For one thing, you do assignment without the "$", so even if you tried, it would be $ set ?=127
$ echo $?
0

However, it doesn't achieve the desired result, as...
4,670
Posted By Gee-Money
Quick word about this, and this is true of Bash,...
Quick word about this, and this is true of Bash, so I'm not sure if it is true in ksh...

You would need to use the "=~" operator, not just "=" to use the regular expressions.

[[ "stuff" =~...
14,661
Posted By Gee-Money
just curious, why would we need the "which"...
just curious, why would we need the "which" command?

if "clear" is in our path, then wouldn't this work:

alias c='clear'

if "clear" is not in our path, then it is not going to work either...
2,877
Posted By Gee-Money
You dont need all the extra "echo" commands for...
You dont need all the extra "echo" commands for one thing. Also, you need to use double quotes. The only time you should not use double quotes in the shell, are when yo uhave special characters that...
4,303
Posted By Gee-Money
I always tell people that are new to Linux/UNIX...
I always tell people that are new to Linux/UNIX to concentrate on learning the Shell language itself (including shell scripting).

The shell is one of the common denominators of Linux/UNIX flavors....
12,389
Posted By Gee-Money
VAR=$(time dd if=/dev/zero of=/dev/sda1 bs=512...
VAR=$(time dd if=/dev/zero of=/dev/sda1 bs=512 count=2048;sync)

What you were doing before was basically:

time <output of "dd" command>

which doesn't make sense because the syntax for "time"...
Showing results 1 to 25 of 47

 
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy