Search Results

Search: Posts Made By: cooldude
5,058
Posted By cooldude
This works: #!/apps/python/2.3.4/bin/python ...
This works:

#!/apps/python/2.3.4/bin/python

import os
import sys
import time

user = os.getenv("LOGNAME").replace("LOGNAME=", "")
string = time.strftime("%m%d%y0000 " + user, time.gmtime())
5,058
Posted By cooldude
Thanks.
Thanks.
5,058
Posted By cooldude
Script not working when called by cron
Hello,

I have the following script which works fine when ran from the command line:

#!/apps/python/2.3.4/bin/python

import os
import sys
import time

user = os.getenv("USER")
string =...
29,431
Posted By cooldude
BMDan, maxdepth is not standard; it only works on...
BMDan, maxdepth is not standard; it only works on GNU find. My Solaris workstation does not have GNU find. Instead, a variation of a command posted by Perderabo...
29,431
Posted By cooldude
Vijay, that does not work if a period is in the...
Vijay, that does not work if a period is in the middle. See the following:

/tmp/tmp> ls -l
total 16
drwxr-xr-x 2 common 240 Jul 22 09:42 asdf.jkl
-rw-r--r-- 1 common 0...
29,431
Posted By cooldude
Vijay, that does not work if a sub directory name...
Vijay, that does not work if a sub directory name contains a ".". You may think that's uncommon, but the first time I tried your command, it failed because the directory I was in had a period!
3,930
Posted By cooldude
I recommend Franklin's solution. But here's...
I recommend Franklin's solution. But here's another version:

#!/bin/ksh

if [ $# != 2 ]
then
exit 1
fi

while read i
do
while read j
do
set -A array $i
field7=${array[6]}...
3,930
Posted By cooldude
If you really want to speed things up, store the...
If you really want to speed things up, store the contents of the first file in an array. Then read the records of the second file one by one and compare the seventh, 13th, and 14th records against...
3,930
Posted By cooldude
Franklin's script runs really fast. If memory is...
Franklin's script runs really fast. If memory is an issue, though, try the following:

#!/bin/ksh

if [ $# != 2 ]
then
exit 1
fi

IFS="|"

while read i
do
set -A array $i

...
3,930
Posted By cooldude
Just as an aside, when I process the first two...
Just as an aside, when I process the first two files with that script, I don't get the output in third script. I get:
...
12,711
Posted By cooldude
I've dozens of aliases defined. I don't want to...
I've dozens of aliases defined. I don't want to create a script for each of them.
But here's what I trying to do. I'm writing a script that runs commands in a sequence. If one of the commands...
12,711
Posted By cooldude
Is there a way to send the command to the shell...
Is there a way to send the command to the shell where the script is being executed?
11,419
Posted By cooldude
Not to hijack this topic, I've had problems like...
Not to hijack this topic, I've had problems like this before, except that I was passing variables to scripts, i.e.,

asdf="\( -name '*.hh' -o -name '*.cc' -o -name '*.c' \-o -name '*.h' \)"
find...
12,711
Posted By cooldude
How can I solve this problem? This seems as if...
How can I solve this problem? This seems as if this can happen in any language I use.
11,419
Posted By cooldude
Firstly, you're not going to get any output in...
Firstly, you're not going to get any output in temp2.txt because you are passing "-n" which suppresses output.
Secondly, I'm still trying to figure out why you can't run a command when the command...
12,711
Posted By cooldude
They are shell constructs, but os.system()...
They are shell constructs, but os.system() invokes the the shell. It is no different than the system() call in Unix. In fact, it probably calls system. That's why I see "sh: x: not found"
11,419
Posted By cooldude
I'm not seeing that. Here are the contents of...
I'm not seeing that.
Here are the contents of temp.txt:
sed -n '/08465696_1215781522540/,/70225547_1215781581748/p' test1.txt

Here is my script, test:

#!/bin/ksh

sedcmd=$(grep sed...
12,711
Posted By cooldude
Accessing aliases within a shell script
I am not able to access the aliases in my environment within a Python script. If I pass the alias to os.system(), I get a message saying "sh: x: not found". I've tried sourcing my .bashrc file in...
8,865
Posted By cooldude
Try this: gawk \ '{ if(NR == 1) { ...
Try this:

gawk \
'{
if(NR == 1)
{
prev = $NF
print $0
}
else
{
if($NF == prev)
print $0
else
{
print "\f"
print $0
prev = $NF
}
}
32,206
Posted By cooldude
Here's what I did to get your output. This...
Here's what I did to get your output. This should give you idea on what to do:

gawk \
'{
if(NR == 1)
{
split($0, tmp);

for(i = 1; i <= NF; i++)
fields[tmp[i]] = i

print "Name...
32,206
Posted By cooldude
You seem to be doing more than what you...
You seem to be doing more than what you described. But here's what I did:

gawk 'BEGIN {print "Name Age Sex alias nfld xsd"}
{if(NR > 1) print $1 " " $2 " " $3 " " $6 " " $5 " " $7}' log.txt
Forum: Solaris 06-17-2008
2,971
Posted By cooldude
Opera 9.5 for Sparc
Has anyone gotten Opera 9.5 to work? I'm using Solaris Sparc 5.10. The browser is unusable. It crashes even when viewing Opera's Desktop Team blog. I've asked Opera...
Forum: Solaris 06-13-2008
12,437
Posted By cooldude
This doesn't seem to be a Sun Solaris issue. Can...
This doesn't seem to be a Sun Solaris issue. Can this be moved to the Dummies forum?
Forum: Solaris 06-12-2008
12,437
Posted By cooldude
Apparently the version of Python I have was not...
Apparently the version of Python I have was not compiled with the readline library: A. Interactive Input Editing and History Substitution (http://docs.python.org/tut/node15.html) . My sysadmin isn't...
5,295
Posted By cooldude
You can write into Excel files using a Perl...
You can write into Excel files using a Perl module (http://www.ibm.com/developerworks/linux/library/l-pexcel).
Showing results 1 to 25 of 44

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