I'm trying to capture the date/time portion of "ls -l" command as a file, but it puts a "blank line". How do I make it so that output file doesn't include a blank line?
Example 1 (saved as a variable works good):
var1=`ls -l /file1 | awk '{print $6,$7,$8}'`
echo $var1
May 24 23:06
Example 2...
I'm unable to move a file that I do not own but I'm part of the group the file is assigned to.
Here's the scenario:
userA owns file1
userA belongs to groupX
userB belongs to groupX
file1 has rights of 666
file1 is located in dir1
dir1 and dir2 are owned by userB
dir1 and dir2 are group owned...
I'm trying to configure NIM Master server with 30 clients on Virtual Ethernet Adapter network because the current network setup will not work with NIM for me (bootp can't find the master). Probably need to create a new network to get it to work.
My environment is 2 P5-590's (connected via...
I need help with a script to find only users that starts with a alpha character followed by 4 digits (ie. a9999).
Here's what I did so far (not working):
#!/usr/bin/ksh
cat /etc/passwd | awk -F: '{print $1}' |
while [[ $MORE -ge 1 ]]
do
read USER
if [ len(USER) == 5 ]
then...
I have two files that contains just file names.
The first files has the nfs mount points (ie. /mnt, /nfs1, etc.)
Second file has long file names (ie. /usr/bin/perl, /nfs1/file1, etc.)
I want the third file to contain only the non-nfs mounted files.
Example:
file1:
/mnt
/nfs1
/nfs2
file2...
I'm trying to line up (align) output from "ls -l". I have the following awk command in a script that writes to a file (INFILE has bunch of file names):
#!/bin/sh
for LINE in `cat ${INFILE}`
do
echo `ls -l $LINE | awk '{printf ("%s %s:%s \t %s\n",$1, $3, $4, $9) }'` >> ${FORMATTED}...
I need to find all occurrences of a particular string "Error code 27" from the whole server? I also need the file name associated with it.
I tried the following command, but I only got the results from the current directory: > grep "Error code 27" *
I need to go to all sub-directories and...
How do you contenate numeric value from a line of text?
I need to store just the numbers into a valiable.
#!/bin/ksh
LINE="time_last_login=1220039866"
TIME=<<concatenated value after the "=">>
...
echo $TIME
1220039866
Thank you in advance.
I need a script to figure out if a user's last login was 90 days or older. OS=AIX, shell=Korn
Here's what I have so far:
====
#!/usr/bin/ksh
NOW=`lsuser -a time_last_login root | awk -F= '{ print $2 }'`
(( LAST_LOGIN_TIME = 0 ))
(( DIFF = $NOW - $LAST_LOGIN_TIME ))
lsuser -a...
How do you set the Physical Partition size on rootvg when installing AIX OS from scratch (via CD or NIM installation)? It seems to default to 32MB, but I would like it to be 128MB.
Thanks!
Does anyone know how I can find a process and kill it using one command line (ie. ps -ef | grep process; get PID; kill -9 PID)?
I know in Solaris there's a pkill command, but I didn't find a pkill command in AIX.
I like to run it in a script. How can I do this?
Thanks.
I know that IBM's official stance is that NIM does not work on etherchannel environment, but has anyone able to get around it?
I'm working on a p5-590 LPAR system, and the NIM master and clients are all on the same frame.
Any help is appreciated.
Has anyone run into issues creating a mksysb_resource via NIM?
We get the following messages
0042-001 nim: processing error encountered on "master":
0042-006 m_mkbosi: (From_Master) connect A remote host refused an
attempted connect operation.
This happens on the LPARs on the same frame...
I'm reading 2 input files but not getting expected value.
I should get an alpha value on file_1_data but not getting any.
Please help.
>cat test6.sh
awk '
FILENAME==ARGV[1] { file_1_data[$1]=$0; print "----- 1 Line " NR " -----" $1; next }
FILENAME==ARGV[2] { file_2_data[$1]=$0; print...
I somehow modified the system so that no one can telnet or ssh into this box as any user including root. I might have blown away important files, I don't know.
Please let me know what I have to check to make it so that I can login.
This is what I get when I try to telnet or ssh:
telnet bk02...
How do you change default setting on password expiration field?
My default setting has 15 weeks for "password min age", and I would like it to be 0 for all of my current users as well as futures users created.
I guess there's a default file that I need to update, but I don't know where it is...
How do you user command completion in .sh or .ksh in AIX environment?
I know you can do it by hitting <esc><esc> in bash, but how do you do it in bourne or korn shell in AIX 5.3 environment?
Thanks in advance.
I'm new to the AIX environment, and I need to check the system state at certain interval (10 minutes) to see when it's saturated to take an appropriate actions.
Any help is appreciated.
I would like to "BOLD" print the hostname in the following statement:
export PS1=$USER"@"$(hostname -s):'$PWD>'
Is there a special character I can put before and after the variable to make it bold or blinking?
Thanks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.