Search Results

Search: Posts Made By: lavascript
Forum: Programming 09-08-2010
13,122
Posted By lavascript
Javascript PAC file and variables
Guys i'm new to javascript but have pulled together a PAC file based on requirements.

Problem is i'm not sure how javascript handles variables. I'm proficient with shell script, and a bit of perl....
5,431
Posted By lavascript
Thanks dudes. set -A array does the trick. ...
Thanks dudes.

set -A array does the trick.

I couldn't get eval working surprisingly, as i've used that before successfully. I'll just go with what works as time is always an issue :)

Cheers
5,431
Posted By lavascript
Thanks the replies. The eval basically...
Thanks the replies.

The eval basically doesnt work as i'm not trying to run the return :-


host# cat l
#!/bin/ksh

eval $(: | format | awk '/^(\ +)0/ {print disk1=$2}; /^(\ +)1/ {print...
5,431
Posted By lavascript
store multiple variables in one go
Guys anyone know how i can store fields into multiple variables in one go?

I'm wanting to grab the disk id's from format into disk1 and disk2

Below is what i want to work but i know it doesnt...
1,968
Posted By lavascript
Thanks dude, i should have thought of double awk...
Thanks dude, i should have thought of double awk matching. I was thinking it was way more complicated.

I suppose it will get more complicated if the hour actualy doesnt exist as a string in the...
1,968
Posted By lavascript
Search between 2 strings
Guys any pointers on how to search between 2 sets date strings with time in the below file example :-


02-Feb-2010 23:12:09 GMT event_type::event_details_are_like_this
02-Feb-2010 09:10:29 GMT...
8,343
Posted By lavascript
You actually need 3 slashes. lava@host$...
You actually need 3 slashes.


lava@host$ cat file
one,ABCD\XYZ,Server One
lava@host$
lava@host$ cat run
#!/bin/ksh

VAR="ABCD\\\XYZ"

echo "Var is $VAR"
sed -e 's/'$VAR'/SERVER/' file...
1,682
Posted By lavascript
Reading Awk lines into variables help plz
I have output from luxadm display commands as below :-


DEVICE PROPERTIES for disk: /dev/rdsk/c10t60020F200000C8083F951F4C00012863d0s2
Vendor: SUN
Product ID: T300
...
3,385
Posted By lavascript
sed -e '/exa_resu_adj.*/d' -e '/End of...
sed -e '/exa_resu_adj.*/d' -e '/End of Report.*/d' file



Be interesting to know which is quicker ?

---edit---

Not much in it :-


xxx@xxx$ time awk 'NR>1 && !/^End of Report/' test...
8,848
Posted By lavascript
I use the below options with SSH in various...
I use the below options with SSH in various scripts. Sometimes i have to adjust the -n or use a -N option.

The -o ConnectTimeout=15 may just be for initial connections and therefore not help you...
2,131
Posted By lavascript
Thanks guys. Looks like i'll have to do it in a...
Thanks guys. Looks like i'll have to do it in a script then. No biggy i suppose.

I aint got gnused on this box.

Cheers for the info.
2,131
Posted By lavascript
Dude thats great. thanks. I never thought of...
Dude thats great. thanks. I never thought of splitting it into multiple -e 's.

Danke :)

---------- Post updated at 11:59 AM ---------- Previous update was at 11:51 AM ----------

Actually...
2,131
Posted By lavascript
small sed script on command line.
Can anyone help me get this small sed script to work in shell on the command line?
I need it in a one liner really as i want to edit many scripts in a for loop and dont want to have to invoke a...
3,195
Posted By lavascript
I'd personally get rid of the brackets around the...
I'd personally get rid of the brackets around the foreach, but i dont know tcsh so it may be a requirement. It should work doing for file in file1 file2 file3 ; do awk -F'*' '{print $1}' < $file...
1,647
Posted By lavascript
I've jsut done something similar where you run a...
I've jsut done something similar where you run a script and dependant if its ran from cron (i.e automated) or a shell it either emails the output or just prints to screen.

There are various ways...
3,175
Posted By lavascript
Ok thanks. I'm actually using it in my...
Ok thanks.

I'm actually using it in my example then for the while section instead of saying while valid = 1 i'm just saying while true do bla bla

Its just a case of looping then until input is...
3,175
Posted By lavascript
What does : do in this instance
Guys please see below functions to return a status depending on user input. Both seem to work the same.

The second way has a : line which i can't understand or see in a ksh manual anywhere....
26,094
Posted By lavascript
I'm still not following what you want. You...
I'm still not following what you want.

You need to access each element of an array so you need to reference the element number some how.

You are asking if you can access 2 arrays at the same...
26,094
Posted By lavascript
Couple of things. in is not a variable in...
Couple of things.

in is not a variable in the for num in loop.
I wouldn't use num in the loop as you have it declared for an array. Basically accessing $num will access element 0 of the array.
...
50,810
Posted By lavascript
I could help with exim a bit if you like....but...
I could help with exim a bit if you like....but i'm a new to this forum so not sure if its correct place seeing as this is for shell script help.
1,163
Posted By lavascript
Spotted it! you have funtion ABC ...
Spotted it! you have

funtion ABC

instead of

function ABC
1,163
Posted By lavascript
Should work. $ cat lava #!/bin/ksh ...
Should work.


$ cat lava
#!/bin/ksh

function ABC {
echo "hello world"
}

ABC
$ ./lava
hello world
$



What platform you on?
What ksh ver?
1,951
Posted By lavascript
I assume you have put the correct interpreter at...
I assume you have put the correct interpreter at the top of the script and not just copied what we put in the post here?

I was just using your origiinal example and adapting the bits accordingly....
1,951
Posted By lavascript
Sorry i just copied your original code and forgot...
Sorry i just copied your original code and forgot to remove the $ from the variable assignment.

See vgersh99's solution.

you could use either ' ' or " " in this instance.
10,580
Posted By lavascript
I think you are getting a process id of the...
I think you are getting a process id of the external echo command you are invoking inside back ticks.

Check this :-


#!/bin/ksh

echo "Current script pid = [$$]"
nohup sleep 60 &
echo...
Showing results 1 to 25 of 55

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