Search Results

Search: Posts Made By: Cranie
3,042
Posted By Cranie
My script already utilises getops, the -d and -t...
My script already utilises getops, the -d and -t can be passed or not as per my example. That allows a user to specify a certain path or use a config file if there are mutiple paths (this is a backup...
3,042
Posted By Cranie
thanks for the reply. tmpPATH=${1} ...
thanks for the reply.

tmpPATH=${1}
tmpTAG=${2}


Don't have to be before the main function, the main function can get called with either the file or passed variables.

The problem I had with...
3,042
Posted By Cranie
While loop only if a condition is met
All,

I wrote the following section of code (which logically in PHP would of worked):

tmpPATH=${1}
tmpTAG=${2}

if [ "${tmpPATH}" == "" -a "${tmpPATH}" == "" ]
then
while read tmpTAG...
5,074
Posted By Cranie
Thank(ed)s for the replies.. @radoulov no...
Thank(ed)s for the replies..

@radoulov
no expect, the other shells do exist will investigate - didn't realise we even had those installed lol

@methyl
Yeah ps -ef is not my favourite. In the...
5,074
Posted By Cranie
@methyl this is a perf test suite of scripts and...
@methyl this is a perf test suite of scripts and this "test" is to simulate Teradata, and network performance to the ETL box.

So currently have a script to run X predefined queries for Y minutes....
5,074
Posted By Cranie
I can't, the "td" command connects to the...
I can't, the "td" command connects to the database and returns the rows. Initially I had:

export NUMROWS=`td "select * from dbc.database" 2> /dev/null |
grep "Query completed" | sed -e...
5,074
Posted By Cranie
Export variable, as a background process
Have a script where I need to wait for a process to run, but from that process I want to capture the row count.

Script I have so far (easier than explanation):

echo "Start"
export NUMROWS=`td...
2,412
Posted By Cranie
NFS export need to be able to write to directory but not list
My issue is I want an NFS share where I can write to the directory, but not list any of the files in there. (doesn't matter if someone knows the name can open the file).

Have an NFS export for...
2,689
Posted By Cranie
@Andre_Merzky @Methyl Thanks for the replies,...
@Andre_Merzky @Methyl
Thanks for the replies, think both would work if I was searching in the directory above. The issue is its a linked directory and I am searching lower down the path i.e:
...
2,689
Posted By Cranie
The original command is: find...
The original command is:


find ${DATAENV}/raw/archive/storage -mtime +4 -type fd


The ${DATAENV}/raw is the linked area. so find can't tell that the levels preceeding are links.

I tried...
2,689
Posted By Cranie
find - link - error
Have a random question:

In simple terms I have a find command on a dir:

/path/user/data/

/path/user is a link to:

/tmp/storage/


The find command outputs the files it finds as:
...
Forum: OS X (Apple) 06-13-2009
5,838
Posted By Cranie
Think I've sorted it. MagicISO, Crossover.....
Think I've sorted it. MagicISO, Crossover.. unfortunately Windows to the rescue.. :-(

Is there a MagicISO equivalent for OSX?
Forum: OS X (Apple) 06-12-2009
5,838
Posted By Cranie
Can't Mount Disk / Image after bad unmount
I have had a little issue with one of my disks, the usb cacble was pulled out and one of the external drives on it would no longer mount. I used First Aid and it verified and repaired both OK /...
53,360
Posted By Cranie
this should enable you to find the PID and allow...
this should enable you to find the PID and allow you to killl / stop the script.

ps -ef | grep "scriptname"
4,991
Posted By Cranie
in this instance you could use: printf...
in this instance you could use:

printf "%8.1f \n" $var | sed 's/...\./,&/g'

But for something with more than 5 characters or less than 4 this wouldn't work.
17,140
Posted By Cranie
sorted! eval `awk < file ' { print "export...
sorted!

eval `awk < file ' { print "export TESTVAR=" $1 } '`

forgot about eval!!!
17,140
Posted By Cranie
andryk, I could write the awk output to a temp...
andryk, I could write the awk output to a temp file and then execute this generate script, but I was trying to avoid the use of temporary files if possible.
17,140
Posted By Cranie
Set a variable from awk output - RESOLVED
I have a file which I am processing using awk to spit out the following:

export CLIENT=1 ; export USER=1 ; export METABASE=1 ; export TASK=1 ; export TOTAL=3

What i want to do now is execute...
9,919
Posted By Cranie
matrixmadhan - this will print the lonest line...
matrixmadhan - this will print the lonest line rather than the longest word though won't it?
9,919
Posted By Cranie
Sure it can be done a lot simpler.... awk...
Sure it can be done a lot simpler....


awk ' BEGIN {
X=0
}
{
n = 1
while ( n <= NF ) {
Y =...
13,493
Posted By Cranie
Robotronic's way works.. many thanks... ...
Robotronic's way works.. many thanks...

Basically we have an export from an application where description fields can contain any characters. Currently on the third column this is defined as...
13,493
Posted By Cranie
csv files (with quoted commas) and awk
I have a file as follows:

1,"This is field 2",3,4,5
2,"This is field 2 it can contain one , comma",3,4,5
3,"This is field 2 it also, can, contain, more",3,4,5
4,"This is field 2 without extra...
9,844
Posted By Cranie
Recursion is allowed (where i work) at a depth of...
Recursion is allowed (where i work) at a depth of 9 iterations. Basically what your script is doing is:

run main,
---> call message,
---------->run main,
-------------->call message

That...
3,769
Posted By Cranie
thanks for the quick replies, we don't have...
thanks for the quick replies,

we don't have the "grep -o" option, the answer which works best for my needs is:

sed -n -e "s/.*\(needle\).*/\1/p" haystack

Again thanks for all the replies,
...
3,769
Posted By Cranie
Display only found string
Is there a way for grep to output only the found string and not the whole line?

I have a ksh script which reads in a file and loops through every line looking up on a grep -f list. For it to only...
Showing results 1 to 25 of 27

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