Search Results

Search: Posts Made By: Nadielosabra
2,389
Posted By MadeInGermany
If there is the rstat service enabled then you...
If there is the rstat service enabled then you can remotely query the uptime
rup remotehostname
2,389
Posted By Neo
Well, it's probably me, but I still do not...
Well, it's probably me, but I still do not understand what you are trying to do exactly and why you think you need to put a root password in a shell script.

If you need to get stats from a machine...
2,389
Posted By Neo
I just checked (on Linux) and who -b works for...
I just checked (on Linux) and who -b works for non-root users:

neo:~$ who -b
system boot 2019-01-30 00:24

You cannot run who -b from a non-root user account on AIX?
3,992
Posted By Aia
A bit cleaner perl -le 'print time'
A bit cleaner
perl -le 'print time'
1,619
Posted By MadeInGermany
Show field 8 and higher cut -d";" -f8-...
Show field 8 and higher
cut -d";" -f8- file
3,992
Posted By Corona688
perl -e 'print time(), "\n";'
perl -e 'print time(), "\n";'
3,992
Posted By bakunin
If i remember AIX 4.3.2 correctly (sorry, but is...
If i remember AIX 4.3.2 correctly (sorry, but is been a long time) there should be the "%T" option which displays the (24h-)time in the format "HH:MM:SS".

Check this with the man page of date i...
1,619
Posted By bakunin
The routine is always the same: please post some...
The routine is always the same: please post some sample of your input and a terminal session with some command executed on this data and its oucome: error messages, return codes, diagnostics and...
3,992
Posted By RudiC
Wouldn't this suffice: awk 'BEGIN {print...
Wouldn't this suffice:
awk 'BEGIN {print srand()}'
1487859688?
3,992
Posted By vgersh99
try this to get epoch time: nawk 'BEGIN...
try this to get epoch time:

nawk 'BEGIN {srand();time=srand();print time}' </dev/null
6,566
Posted By Don Cragun
Note that since an assignment returns the value...
Note that since an assignment returns the value assigned and since the value being assigned is not an empty string and is not zero, the script can be written as just a condition with the default...
3,992
Posted By Corona688
You can try my general purpose date script...
You can try my general purpose date script (https://www.unix.com/unix-for-beginners-questions-and-answers/239167-general-purpose-date-script.html) which is a GNU-date-alike written in Perl, which...
1,619
Posted By Corona688
You are working with the same data as in your...
You are working with the same data as in your other thread, looks like.

Another way to do it is $ echo "FT71;1;1;1;;;1;31.01.2017 11:12:24;0" | awk '{ NF=6 } 1' FS=";" OFS=";" -

FT71;1;1;1;;
...
6,566
Posted By Corona688
A code block followed by an expression like that,...
A code block followed by an expression like that, prints the line whenever the expression is true. As an expression, 1 is always true.

The code block is actually optional. Just awk '1' filename...
6,566
Posted By MadeInGermany
It's the geek version of {print}. In fact it...
It's the geek version of {print}.
In fact it gives a non-zero =true value in an implicit if where the default action is {print}.
1,619
Posted By bakunin
Sorry for moving around your thread, i wrongly...
Sorry for moving around your thread, i wrongly thought it deals with the same problem as your other thread.



This is actually exactly the way cut works:

# printf "\"%s\"\n" $(echo...
6,566
Posted By MadeInGermany
The substitution needs the field to end with the...
The substitution needs the field to end with the semicolon delimiter.
Not true for the last field.
A simple relief is
sed '
s/$/;/
s/[^;]*;/1;/6
s/;$//
' file
awk is the better tool to work...
6,566
Posted By Scrutinizer
sed version: sed 's/[^;]*;/1;/6' file
sed version:
sed 's/[^;]*;/1;/6' file
6,566
Posted By vgersh99
I bet it's the second field (position 6 currently...
I bet it's the second field (position 6 currently with the value of 3)
6,566
Posted By Corona688
If I understand you: awk '{ $6=1 } 1' FS=";"...
If I understand you: awk '{ $6=1 } 1' FS=";" OFS=";" inputfile > outputfile
4,171
Posted By vbe
You may add this at the beginning of ...
You may add this at the beginning of /etc/profile

# Environment used in interactive mode is to be defined here
case "$0" in
-ksh | -sh) # add here the shells used...
4,171
Posted By rbatte1
Given that /etc/inittab is a system file that...
Given that /etc/inittab is a system file that could be replaced during an upgrade (okay, so you probably won't be patching AIX 4) I would suggest it is a bad place to put things. Assuming it has the...
4,171
Posted By bakunin
You are right, sorry. That was an oversight on my...
You are right, sorry. That was an oversight on my part.



OK. Can you post the script you have trouble with? Because, honestly, i have written scripts and put them in inittab before and i didn't...
4,171
Posted By bakunin
OK, so at least we have established you are using...
OK, so at least we have established you are using AIX. Care to tel us which version? Issue:

oslevel -s

to display it. Please post the output.



You should - under absolutely no...
4,171
Posted By vbe
To help you, we'd have to know a bit more about...
To help you, we'd have to know a bit more about the script...
Who do you think runs the script in /etc/inittab ?

Let's say it must be oracle, and as we all kmow, oracle will not run like that,...
Showing results 1 to 25 of 26

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