Search Results

Search: Posts Made By: ejianu
5,702
Posted By ejianu
Using awk I don't get any output. Using...
Using awk I don't get any output.

Using /usr/xpg4/bin/awk I get the following:


/usr/xpg4/bin/awk -F, -vYD=20170629 '$0 ~ "^" YD {for (i=2; i<=NF; i++) if (MAX[i] <= $i) MAX[i] = $i} END {for...
5,702
Posted By ejianu
date doesn't like date -d"-1day" So I've...
date doesn't like
date -d"-1day"
So I've changed your code to
awk -F, -vYD=20170702 '$0 ~ "^" YD {for (i=2; i<=NF; i++) if (MAX[i] <= $i) MAX[i] = $i} END {for (i=2; i<=NF; i++) printf "%s%s",...
5,702
Posted By ejianu
I'll take yesterday's date with the following....
I'll take yesterday's date with the following. Should be ok, as I don't intend to run the script close to midnight:


YESTERDAY=`TZ=GMT+24 date +%Y%m%d`;


Then I want to pass YESTERDAY to awk,...
5,702
Posted By ejianu
Get maximum per column from CSV file, based on date column
Hello everyone,

I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this:

20170628-23:25:01,1,0,0,1,1,1,1,55,55,1
20170628-23:30:01,1,0,0,1,1,1,1,56,56,1...
3,801
Posted By ejianu
The following did the trick: print - cp...
The following did the trick:

print - cp "$infile" "${outfile%%_v2}"

Thank you!
3,801
Posted By ejianu
I went with bakunin's suggestion since there are...
I went with bakunin's suggestion since there are multiple sub-directories underneath /dir1/dr2/save and I want to copy the files ending _v2 outside of save and keep the directory structure.
...
3,801
Posted By ejianu
Not sure why they ended up like that, that is not...
Not sure why they ended up like that, that is not the issue though. I confirm I use the correct quotes. I will try adding the quotes one more time below to see if they show up correct:

sed...
3,801
Posted By ejianu
Use find with cp and sed in ksh to copy files to a slightly different location
Hello there wonderful people,

I am running on Solaris 10 and with the following ksh version:

strings /bin/ksh | grep Version | tail -2
@(#)Version M-11/16/88i

Suppose I want to copy files...
Forum: Solaris 10-05-2015
1,921
Posted By ejianu
I have exported the DISPLAY variable but for some...
I have exported the DISPLAY variable but for some reason it doesn't show up.


user@machine:/home/user>env
_=/usr/bin/env
SSH_TTY=/dev/pts/1
PATH=/usr/local/bin:/usr/bin:/bin
EDITOR=vi...
Forum: Solaris 10-01-2015
1,921
Posted By ejianu
All, Thanks for your suggestions. I did a...
All,

Thanks for your suggestions. I did a test with the DISPLAY variable, I have set it in my session and I get to see it when i use env, however when I look for it with pargs -e it's not there. ...
Forum: Solaris 09-30-2015
1,921
Posted By ejianu
How to search for the sessions that have a certain environment variable set?
Hi all,

In Solaris 10, is there a way to search for the sessions that have a certain environment variable set?
1,519
Posted By ejianu
Managed to extract numbers with sed using...
Managed to extract numbers with sed using following command:


sed "s/[^0-9]//g"


---------- Post updated at 04:43 AM ---------- Previous update was at 04:42 AM ----------

What if I wanted...
1,519
Posted By ejianu
Isolate text with sed or similar utility
All,

I'm getting a list like the following and I'd like to kill each PID in turn.

pid (17797)
pid (21748)
pid (21754)
pid (21704)
pid (2199)
...
9,997
Posted By ejianu
Moving the target of a symbolic link
Hello all,

On a Solaris box, I am trying to move the target of a symbolic link.

Let's say the symbolic link looks like the following:
/dir1/dir2/link -> /some/dir/target

I would like to...
13,425
Posted By ejianu
Thank you MadeInGermany! I confirm both of the...
Thank you MadeInGermany! I confirm both of the above work on my Solaris box.
13,425
Posted By ejianu
It works. Thank you!
It works. Thank you!
13,425
Posted By ejianu
RavinderSingh13, Thank you! You are correct,...
RavinderSingh13,

Thank you! You are correct, I am using a Solaris OS.

Using nawk and /usr/xpg4/bin/awk I get the following, which is closer to what I need, but I still get /db at the end. How...
13,425
Posted By ejianu
RavinderSingh13, Thank you for your prompt...
RavinderSingh13,

Thank you for your prompt response. Unfortunately I get the following:

>echo "DBPATH=/some/path/database/db" | awk '{sub(/.*=/,X,$0);print}'
awk: syntax error near line 1...
13,425
Posted By ejianu
How to remove certain character strings with awk?
Hi all,

I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).

Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
...
8,988
Posted By ejianu
Using SSH_CLIENT seems to be a very nice shortcut...
Using SSH_CLIENT seems to be a very nice shortcut for the code I've initially posted.

But I'm curious if there's a way on finding out $n and $m from UNIX.
8,988
Posted By ejianu
How to automatically set the DISPLAY var?
Hi all,

Our users use Putty on Windows servers to log on to UNIX via SSH and run GUI applications. Is there a way to automatically get the display numbers from xming or Exceed (that are running on...
2,828
Posted By ejianu
Thank you. I will use a sed command file.
Thank you. I will use a sed command file.
2,828
Posted By ejianu
I am only interested in the file, I don't need...
I am only interested in the file, I don't need the output on screen.

I guess I could do something like this:

function test123 {
#echo test
sed -e '6s/9/6/' testfile.txt > testfile.txt.2
}
...
2,828
Posted By ejianu
Help needed - ksh: sed: command garbled:
Hi all,

What am I doing wrong here?
$ cat test_sed.ksh
#!/usr/bin/ksh
var="sed -e \'6s/9/6/\' testfile.txt > testfile.txt.2"
$var
$ ./test_sed.ksh
sed: command garbled: \'6s/9/6/\'

Thank...
13,362
Posted By ejianu
All, I decided to go with zaxxon's approach....
All,

I decided to go with zaxxon's approach. Below is how the code looks now. It almost does what I want which is to get the numbers out of top and create statistics that give better view over...
Showing results 1 to 25 of 35

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