Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: trey85stang
969
Posted By trey85stang
gawk convert 2012-Jun-13 to 2012-06-13
I have a value in a file i am processing that has a date like "2012-Jun-13"

how can I convert a date like that 2012-06-13?

Am I stuck building an array of three digit months and corresponding...
12,633
Posted By trey85stang
Thanks for the help! I appreciate it... that...
Thanks for the help! I appreciate it... that was driving me nuts.
12,633
Posted By trey85stang
That is exactly what I am looking for but I get a...
That is exactly what I am looking for but I get a syntax error when in including brackets...

OS: ubuntu 11.10 - gawk version 3.1.7 :confused:


$ awk 'BEGIN {
> for (x = 0; ++x <= 10;)
> ...
12,633
Posted By trey85stang
gawk - How to loop through multidimensional array?
I have an awk script that I am writing and I needed to make use of a multidimensional array to hold some data... Which is all fine but I need to loop through that array now and I have no idea how to...
16,089
Posted By trey85stang
mysql -e is what you are looking for. mysql...
mysql -e is what you are looking for.
mysql -hlocahost -uroot -e "
create table;
do something else;
do one more thing;
"
13,498
Posted By trey85stang
you're spawning an instance of a shell.. you need...
you're spawning an instance of a shell.. you need to exit the shell or spawn scp instead of shell.
Forum: Programming 06-03-2011
2,165
Posted By trey85stang
linux c, loop through 2d array?
I have a 2 d array that I need to loop through and check for a specific value in each variable...

Im a little confiused on how to do this...


#include stdio.h
#include string.h
main ()
{...
7,849
Posted By trey85stang
/sbin/ifconifg | sed '/ *inet/ ! d;...
/sbin/ifconifg | sed '/ *inet/ ! d; /127\.0\.0\.1/d;s/ *inet \(.*\) n.*/\1/'
11,201
Posted By trey85stang
Ive never used chkint, but this should work...
Ive never used chkint, but this should work after the mac is input



MAC=$(echo $MAC | sed "s/\(.*\)/\L\1/")
case $MAC
in
...
12,546
Posted By trey85stang
expect will do what you need. with expect...
expect will do what you need.

with expect you can ssh to the remote box, run passwd, enter in the info, confirm it and exit the ssh session.

---------- Post updated at 12:31 PM ----------...
2,857
Posted By trey85stang
what shell? modern bash: ...
what shell? modern bash:


var=n06-z30-sr65-rgdt0p25-varp0.25-8x6drw-test.cmod
echo ${var##*.}
cmod
1,771
Posted By trey85stang
I forgot to clean that up, it should read mysub....
I forgot to clean that up, it should read mysub. My variable names are not always politically correct so I try to change them before posting.
1,771
Posted By trey85stang
perl launch threads in an array variable?
Im having a problem launching multiple sub routines as threads. My script seems to stop when the first thread is launched.

Im condensing the code for simplification here:


#!/usr/bin/perl -w...
8,289
Posted By trey85stang
awk can do all of that for you.... If i...
awk can do all of that for you....

If i understand correctly your input file is:

123 456 10 11 90 39 20


your desired output is:


123
456
10
11
90
39
20
16,906
Posted By trey85stang
yes it is; Here is a script I use to logon...
yes it is;

Here is a script I use to logon into dell racs to chekc configurations... Id rather just post an example for you because I spent a good 7-8 hours trying to figure out how to do this...
16,906
Posted By trey85stang
expect can use any name/file extension.. I give...
expect can use any name/file extension.. I give them .exp.

Is there are a reason you cannot use ssh keys? expect will do whatever you want... but ssh/bash/ksh or whatever shell is probably way...
1,772
Posted By trey85stang
awk '{if($0 ~ "0$") {print "Zero"} else {print...
awk '{if($0 ~ "0$") {print "Zero"} else {print "number"}}' yourfile

edit: one more:
sed "s/.*[1-9]$/number/g;s/.*0$/zero/g" yourfile


Please use code tags, thank you!
5,330
Posted By trey85stang
ps -ae | awk '/els/ {print $1}' | xargs kill ...
ps -ae | awk '/els/ {print $1}' | xargs kill

I'd use that line to kill els
2,642
Posted By trey85stang
if you have du du -s *.edf
if you have du

du -s *.edf
7,894
Posted By trey85stang
expect script, how to deal with different outputs.
I have an expect script that I need to deal with a few different outputs? Here are the commands I am running

ssh -o StrictHostKeyChecking=no root@$ipaddress "racadm config -g cfgIpmiLan -o...
2,044
Posted By trey85stang
solved -gawk, search for pattern - mark the previous line as a variable?
Im trying to parse ifconfig with awk and setup a bunch of variables in one shot. But Im having trouble figuring out how to work with data in previous lines.

ifconfig output:

eth0 Link...
3,980
Posted By trey85stang
thanks linbit, That was exactly what I was...
thanks linbit, That was exactly what I was looking for!
3,980
Posted By trey85stang
drbd8 skip initial disk sync?
Anyone know how to go about skipping the initial disk sync of a newly created drbd resource?

I'm creating brand new 30gb partitions and would like to skip the entire initial sync, I've read this...
10,054
Posted By trey85stang
Thanks bakunin, Ill give nohup a shot. :)
Thanks bakunin, Ill give nohup a shot. :)
10,054
Posted By trey85stang
[KSH/Bash] Starting a parent process from a child process?
Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know.
...
Showing results 1 to 25 of 106

 

Featured Tech Videos

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