linux - Inconsistent behavior from sudo ls -l and grep command running on AIX 6.1 TL9 SP1 after upgrade from AIX 6.1 TL8 SP3
2014-07
Here is an example with grep
[(qtjbc)l17asp03:/db2/DEV/scripts/updatekrnl]>sudo grep lt start_sap.ksh
corp AD Password:
if [[ $# -lt 2 ]] then
while [[ ${IND} -lt ${NUMOFMOUNTS} ]]
Eko "rdisp/start_icman not set in instance profile, default value (TRUE) is being used" >> ${LOGFILE}
[(qtjbc)l17asp03:/db2/DEV/scripts/updatekrnl]>grep lt start_sap.ksh
if [[ $# -lt 2 ]] then
while [[ ${IND} -lt ${NUMOFMOUNTS} ]]
Eko "rdisp/start_icman not set in instance profile, default value (TRUE) is being used" >> ${LOGFILE}
Eko "rdisp/j2ee_start not set in instance profile, default value (FALSE) is being used" >> ${LOGFILE}
Eko "${b} was added to BWPROCESSES, however, do not know what the default value is set to" >> ${LOGFILE}
if [[ ${RUNNINGPROCS} -lt ${NUMPROCS} ]] then
I am seeing something odd with servers that have been moved to Corp AD. Some commands are not giving accurate or on consistent results.
You can see here that the same command generates different results. I am noticing with grep. I am not sure if is the user migration or the AIX patch since all the servers patched have been migrated to Corp AD.
[(qtjbc)l17asp03:/home/qtjbc]>sudo ls -l
total 47112
-rw------- 1 qtjbc printq 324 May 07 2013 .Xauthority
-rw-r--r-- 1 devadm sapsys 956 Sep 12 2002 .adm_profile
-rwxrwxrwx 1 qtjbc sapsys 2596 May 28 2012 .exit
-rw-r----- 1 qtjbc staff 430 Jul 18 2011 .profile
-rwxr----- 1 qtjbc staff 389 Jul 07 2011 .profile.110707.145608
-rw-r----- 1 qtjbc staff 419 Jul 07 2011 .profile.110718.112707
-rw------- 1 qtjbc printq 8220 Jun 09 2010 .sh_history
-rw------- 1 qtjbc printq 80124 Apr 30 2010 .sh_history.0
-rw------- 1 qtjbc printq 103702 Apr 08 2010 .sh_history.1
-rw------- 1 qtjbc printq 7464 May 12 2009 .sh_history.10
-rw------- 1 qtjbc printq 974 Apr 16 2009 .sh_history.11
-rw------- 1 qtjbc printq 750 May 12 2009 .sh_history.12
-rw------- 1 qtjbc printq 1456 Mar 29 2007 .sh_history.14
-rw------- 1 qtjbc printq 1974 May 08 2009 .sh_history.15
[(qtjbc)l17asp03:/home/qtjbc]>sudo ls -l
total 47112
-rw------- 1 qtjbc printq 324 May 07 2013 .Xauthority
-rw-r--r-- 1 devadm sapsys 956 Sep 12 2002 .adm_profile
-rwxrwxrwx 1 qtjbc sapsys 2596 May 28 2012 .exit
-rw-r----- 1 qtjbc staff 430 Jul 18 2011 .profile
-rwxr----- 1 qtjbc staff 389 Jul 07 2011 .profile.110707.145608
-rw-r----- 1 qtjbc staff 419 Jul 07 2011 .profile.110718.112707
-rw------- 1 qtjbc printq 8220 Jun 09 2010 .sh_history
-rw------- 1 qtjbc printq 80124 Apr 30 2010 .sh_history.0
-rw------- 1 qtjbc printq 103702 Apr 08 2010 .sh_history.1
-rw------- 1 qtjbc printq 7464 May 12 2009 .sh_history.10
-rw------- 1 qtjbc printq 974 Apr 16 2009 .sh_history.11
-rw------- 1 qtjbc printq 750 May 12 2009 .sh_history.12
-rw------- 1 qtjbc printq 1456 Mar 29 2007 .sh_history.14
-rw------- 1 qtjbc printq 1974 May 08 2009 .sh_history.15
-rw------- 1 qtjbc printq 56042 May 03 2010 .sh_history.2
-rw------- 1 qtjbc printq 41664 Apr 30 2010 .sh_history.3
-rw------- 1 qtjbc printq 94730 Apr 19 2010 .sh_history.4
-rw------- 1 qtjbc printq 17430 Apr 21 2010 .sh_history.5
-rw------- 1 qtjbc printq 25670 Mar 31 2010 .sh_history.6
-rw------- 1 qtjbc printq 17790 Mar 26 2010 .sh_history.7
-rw------- 1 qtjbc printq 13600 Mar 23 2010 .sh_history.8
-rw------- 1 qtjbc printq 4152 Feb 26 2010 .sh_history.9
drwxr-xr-x 2 qtjbc printq 256 Apr 06 2011 .ssh
drwx------ 2 root system 256 Feb 14 2011 .topasrecrc
-rw------- 1 qtjbc staff 44 Apr 30 11:59 .vas_disauthcc_100507944
-rw-r--r-- 1 qtjbc staff 28 Apr 30 11:59 .vas_logon_server
-rw------- 1 qtjbc printq 278 Apr 30 12:00 .vi_history
-rw-r--r-- 1 root system 360 Sep 24 2004 03.tmp
-rw-r--r-- 1 root system 675 Sep 24 2004 15.tmp
-rw-r----- 1 qtjbc printq 654 May 07 2012 8
-rw-r----- 1 qtjbc printq 633 May 07 2012 9
-rw-r--r-- 1 root system 49 Feb 09 2011 AverageCheckCPU.out
drwxr-x--- 2 qtjbc printq 256 May 28 2012 CPU
-rwxr-x--x 1 qtjbc printq 2122 Feb 20 2013 CheckAverageCPU.ksh
-rw-r----- 1 qtjbc printq 0 Feb 09 2011 CheckAverageCPU.ksh.110209.082437
-rw-r--r-- 1 root system 870 Feb 20 2013 CheckAverageCPU.log
-rw-r--r-- 1 root system 0 Feb 20 2013 CheckAverageCPU.out
-rwxr-xr-x 1 qtjbc printq 2334 May 16 2012 CheckCPU.ksh
-rw-r----- 1 qtjbc printq 0 Jan 18 2011 CheckCPU.ksh.110118.124127
-rwxr-x--x 1 qtjbc printq 1691 Jan 18 2011 CheckCPU.ksh.110118.133326
-rwxr-x--x 1 qtjbc printq 1743 Jan 18 2011 CheckCPU.ksh.110118.134726
-rwxr-x--x 1 qtjbc printq 1744 Jan 18 2011 CheckCPU.ksh.110118.142726
-rwxr-x--x 1 qtjbc printq 1752 Jan 18 2011 CheckCPU.ksh.110124.100925
-rwxr-x--x 1 qtjbc printq 1995 Jan 24 2011 CheckCPU.ksh.120514.155427
-rwxr-xr-x 1 qtjbc printq 2222 May 14 2012 CheckCPU.ksh.120515.143528
-rwxr-xr-x 1 qtjbc printq 2223 May 15 2012 CheckCPU.ksh.120516.092926
-rwxr-xr-x 1 qtjbc printq 2222 May 16 2012 CheckCPU.ksh.120516.100327
-rwxr-xr-x 1 qtjbc printq 2222 May 16 2012 CheckCPU.ksh.120516.103327
-rwxr-xr-x 1 qtjbc printq 2334 May 16 2012 CheckCPU.ksh.120516.122626
-rw-r--r-- 1 root system 36808 Apr 28 07:00 CheckCPU.log
-rw-r--r-- 1 root system 0 Apr 28 07:00 CheckCPU.out
-rwxrwxrwx 1 qtjbc sapsys 2587 May 28 2012 CheckCPU.par
-rwxr-xr-x 1 qtjbc printq 2232 May 14 2012 CheckCPU_test.ksh
-rwxr-x--x 1 qtjbc printq 2000 May 14 2012 CheckCPU_test.ksh.120514.131926
-rwxr-x--- 1 qtjbc printq 5221 Jan 24 13:29 CheckDisk.ksh
-rw-r--r-- 1 root system 16824 Apr 30 07:01 CheckDisk.log
-rw-r--r-- 1 root system 7 Apr 30 07:01 CheckDisk.out
-rw-r----- 1 qtjbc printq 696 Jan 24 12:32 CheckDisk.par
-rw-r----- 1 qtjbc printq 696 Jan 24 12:32 CheckDisk.par.x
-rwxr-x--- 1 qtjbc printq 4272 Jan 24 13:54 CheckDisk2.ksh
-rw-r----- 1 root system 815 Jan 24 16:16 CheckDisk2.log
-rw-r----- 1 qtjbc printq 696 Jan 24 12:32 CheckDisk2.par
-rwxrwxrwx 1 qtjbc printq 459 May 10 2011 CheckEPI-Use.ksh
-rw-r--r-- 1 root system 21949 May 10 2013 CheckEPI-Use.log
-rw-r--r-- 1 root system 0 May 10 2013 CheckEPI-Use.out
-rwxrwxrwx 1 root system 1187 Aug 10 2010 CheckJobLogs.ksh
-rwxr-xr-x 1 qtjbc printq 9166 Jun 18 2013 CheckMemory.ksh
-rwxr-x--x 1 qtjbc printq 1671 Jan 13 2011 CheckMemory.ksh.110114.164026
-rwxr-x--x 1 qtjbc printq 3154 Jan 14 2011 CheckMemory.ksh.110118.164026
-rwxr-x--x 1 qtjbc printq 3975 Jan 18 2011 CheckMemory.ksh.110121.083226
-rwxr-x--x 1 qtjbc printq 4166 Jan 21 2011 CheckMemory.ksh.110124.095626
-rwxr-x--x 1 qtjbc printq 4164 Jan 24 2011 CheckMemory.ksh.110124.114726
-rwxr-x--x 1 qtjbc printq 4164 Jan 24 2011 CheckMemory.ksh.110201.153523
-rwxr-x--x 1 qtjbc printq 7918 Feb 01 2011 CheckMemory.ksh.110201.160937
-rwxr-x--x 1 qtjbc printq 7917 Feb 01 2011 CheckMemory.ksh.110202.100837
-rwxr-x--x 1 qtjbc printq 8198 Feb 02 2011 CheckMemory.ksh.121112.082845
-rwxr-x--x 1 qtjbc printq 8463 Nov 12 2012 CheckMemory.ksh.121126.100246
-rwxr-x--x 1 qtjbc printq 8464 Nov 26 2012 CheckMemory.ksh.121126.101445
-rwxr-x--x 1 qtjbc printq 8463 Nov 26 2012 CheckMemory.ksh.130510.084947
-rwxr-xr-x 1 qtjbc printq 8637 May 10 2013 CheckMemory.ksh.130618.093747
-rw-r--r-- 1 root system 95825 Apr 30 07:00 CheckMemory.log
-rw-r--r-- 1 root system 7 Apr 30 07:00 CheckMemory.out
-rwx------ 1 root system 1777 May 10 2011 CheckWorkFlowLogs.ksh
-rwxrwxrwx 1 root system 1788 Aug 10 2010 CheckWorkFlowLogs.ksh.090622:145204
-rwx------ 1 root system 1817 Nov 10 2009 CheckWorkFlowLogs.ksh.100723.183525
-rwx------ 1 root system 1794 Jun 22 2009 CheckWorkFlowLogs.ksh.110502.154532
-rwx------ 1 root system 1795 May 02 2011 CheckWorkFlowLogs.ksh.110510.121530
-rw-r--r-- 1 root system 532 Nov 10 2009 CheckWorkFlowLogs.log
-rw-r--r-- 1 qtjbc staff 30783 Aug 10 2010 DEV
-rw-r--r-- 1 qtjbc printq 506 Aug 10 2010 DEV.old.030707:114536
-rw-r--r-- 1 root system 110 Jun 21 2003 DEV.tmp
-rw-r--r-- 1 root system 1386 Mar 23 2004 DNT.tmp
-rwxr-x--- 1 qtjbc printq 1240 Apr 01 16:37 DeleteDataSyncManagerFile.ksh
-rw-r--r-- 1 root system 111676 Jan 01 2011 DeleteDataSyncManagerFile.log
-rw-r--r-- 1 root system 16835 Apr 01 06:10 DeleteDataSyncManagerFile.out
-rwxr-x--- 1 qtjbc printq 2666 May 10 2011 DeleteWorkFlowLogs.ksh
-rwxrwxrwx 1 root system 2006 Aug 10 2010 DeleteWorkFlowLogs.ksh.090416:143305
-rwxr-x--- 1 qtjbc printq 1249 Aug 10 2010 DeleteWorkFlowLogs.ksh.090501:095205
-rwxr-x--- 1 qtjbc printq 1249 Aug 10 2010 DeleteWorkFlowLogs.ksh.091202:144705
-rwxr-x--- 1 qtjbc printq 1229 Aug 10 2010 DeleteWorkFlowLogs.ksh.091208:123307
-rwxr-x--- 1 qtjbc printq 2683 Aug 10 2010 DeleteWorkFlowLogs.ksh.100723.184525
-rwxr-x--- 1 qtjbc printq 2683 Aug 10 2010 DeleteWorkFlowLogs.ksh.100804.162125
-rwxr-x--- 1 qtjbc printq 2683 Aug 10 2010 DeleteWorkFlowLogs.ksh.110502.154031
-rwxr-x--- 1 qtjbc printq 2684 May 02 2011 DeleteWorkFlowLogs.ksh.110510.122030
-rw-r--r-- 1 root system 598848 Apr 01 06:00 DeleteWorkFlowLogs.log
-rw-r--r-- 1 root system 0 Apr 01 06:00 DeleteWorkFlowLogs.out
-rw-r--r-- 1 root system 112 Apr 01 06:00 DeleteWorkFlowLogs.wrk
-rwxrwxrwx 1 root system 1980 Aug 10 2010 DeleteWorkFlowLogs2.ksh
-rw-r--r-- 1 root system 60026 Nov 01 2007 DeleteWorkFlowLogs2.log
-rw-r--r-- 1 qtjbc printq 3 Aug 10 2010 FIRST.out
-rwxrwxrwx 1 root system 761 Aug 10 2010 FixTransports.ksh
-rw-r--r-- 1 root system 45 Jun 27 2003 HRsectrans
-rw-r--r-- 1 qtjbc printq 115 Aug 10 2010 PURGE.out
-rw-r--r-- 1 qtjbc staff 24799 Aug 10 2010 QAS
-rwxrwxrwx 1 root system 1171 Aug 10 2010 ReadTransports.ksh
-rwxrwxrwx 1 root system 1187 Aug 10 2010 RemoveJobLogs.ksh
-rw-r--r-- 1 qtjbc printq 4 Aug 10 2010 SID.out
-rw-r----- 1 qtjbc printq 9775 Aug 10 2010 SU53.txt
-rwxrwx--- 1 devadm sapsys 270 Aug 10 2010 addto150
-rwxrwx--- 1 devadm sapsys 1709 Aug 10 2010 addtobuffer
-rwxrwx--- 1 devadm sapsys 1735 Aug 10 2010 addtodev
-rwxr----- 1 qasadm sapsys 1305 Jun 27 2003 addtoqas
-rw-r--r-- 1 root system 30552 Sep 24 2004 asp.tmp
-rw-r--r-- 1 qtjbc printq 43636 Oct 13 2011 backup.file
-rw-r--r-- 1 root system 148826 Oct 13 2011 backup.file.out
-rw-r--r-- 1 root system 0 Jun 25 2013 backup.out
-rw-r--r-- 1 qtjbc printq 8002264 Nov 09 2011 backup2.file
-rw-r--r-- 1 root system 4499352 Nov 09 2011 backup2.file.out
-rw-r--r-- 1 root system 5694 Apr 30 10:54 bppllist.out
-rw-r--r-- 1 root system 121 Nov 26 2002 buffer
-rwxrwxrwx 1 root system 95 Aug 10 2010 check.ksh
-rwxr-xr-x 1 qtjbc printq 1527 Dec 07 2012 check_for_scripts.ksh
-rw-r----- 1 qtjbc printq 0 Dec 07 2012 check_for_scripts.ksh.121207.161243
-rw-r--r-- 1 root system 105446 Apr 30 06:00 check_for_scripts.log
-rw-r--r-- 1 root system 0 Apr 30 06:00 check_for_scripts.out
-rwxrwxrwx 1 root system 10296 Aug 10 2010 checkdb2uext2.ksh
-rw-r--r-- 1 root system 2144 Sep 08 2004 checkdb2uext2_DEV.log
-rwxrwxrwx 1 root system 5786 Aug 10 2010 checktransports.ksh
-rwxr--r-- 1 root system 8774 Jul 23 2010 chkscript.ksh
-rwxrwxrwx 1 root system 7741 Aug 10 2010 chkscript.ksh.100429.100828
-rwxr--r-- 1 root system 9491 Apr 29 2010 chkscript.ksh.100723.191526
-rwx------ 1 qtjbc printq 2515 Jan 18 2013 cleanupafterprinterremoval.ksh
-rw-r--r-- 1 root system 586 Jan 18 2013 cleanupafterprinterremoval.log
-rw-r--r-- 1 root system 0 Jan 18 2013 cleanupafterprinterremoval.out
-rw-r----- 1 qtjbc printq 1829 Apr 17 08:06 cron.scripts
-rw-r--r-- 1 root system 4418 Jul 16 2004 ddd.log
-rw------- 1 qtjbc staff 3 Aug 10 2010 dead.letter
-rwxrwxrwx 1 devadm sapsys 983 Aug 10 2010 delbuffer.ksh
-rw-r--r-- 1 qtjbc printq 185621 Aug 10 2010 delete.list
-rw-r--r-- 1 qtjbc printq 185622 Aug 10 2010 delete.list.2
-rw-r--r-- 1 root system 159 Nov 22 2004 dev_shmdiag
-rw-r----- 1 qtjbc printq 3217 Aug 10 2010 df-k.20100621
-rw-r----- 1 qtjbc printq 3282 Aug 10 2010 df-k.20100626
-rw-r----- 1 qtjbc printq 3724 Apr 17 11:14 df-k.out
-rw-r----- 1 qtjbc printq 3583 Apr 17 16:40 df-k140417164001.out
-rw-r--r-- 1 qtjbc printq 13779 Dec 20 2010 directories
-rw-r--r-- 1 qtjbc printq 30725 Aug 10 2010 directories.05
-rw-r--r-- 1 qtjbc printq 25060 Aug 10 2010 directories_03.xls
-rw-r--r-- 1 qtjbc printq 25161 Aug 10 2010 directories_05.xls
-rw-r--r-- 1 qtjbc printq 24992 Aug 10 2010 directories_16.xls
-rw-r--r-- 1 root system 204 Oct 26 2009 distrubute_autotubs.log
-rw-r--r-- 1 qtjbc printq 126 Aug 10 2010 donotdelete
-rw-r--r-- 1 qtjbc printq 2518 Dec 15 2011 enq.out
-rw-r----- 1 qtjbc printq 1 Oct 29 2013 etc
-rw-r--r-- 1 root system 1861 Apr 17 2007 file
-rw-r----- 1 qtjbc printq 723 Jun 06 2013 file.1
-rw-r----- 1 qtjbc printq 13820 Sep 29 2011 file.hist
-rw-r----- 1 qtjbc printq 14011 Feb 08 2012 file.jim
-rw-r----- 1 qtjbc printq 34 May 01 2012 file1
-rw-r----- 1 qtjbc printq 14925 Jan 16 2013 file2
-rw-r--r-- 1 qtjbc printq 334 Aug 10 2010 files
drwxr-xr-x 2 qtjbc printq 256 Aug 10 2010 filestuff
-rw-r--r-- 1 root system 16690 Oct 05 2004 find
I'm having this issue where when I try to use sudo to rcp some files from a Linux host to an HP-UX host (note that the destination directory requires root access to write to), I get the following error from HP-UX's side:
LINUX HOST:/tmp/justin $ sudo rcp ./justin.txt HPUXHOST:/usr/local/bin
remshd: Login incorrect.
I should note that the passwords for the Linux host and the HP-UX host are different. The command doesn't seem to give me a chance to enter the proper HP-UX password and automatically defaults to this error.
"sudo" on this side doesn't give you root on that side. I think you want rcp ./justin.txt root@HPUXHOST:/usr/local/bin
, but even then you'll need the root password on that side, and they will have to allow root remote connections, which is unlikely. It's safer (and more likely to work) if you just rcp it to somewhere neutral (like /var/tmp) on the remote side, and then log into the remote side and use sudo mv
to put it in /usr/local/bin.
You can also use rsync instead to copy the files with sudo
rsync -avz -e "ssh" --rsync-path="sudo rsync"