Sponsored Content
Top Forums Shell Programming and Scripting trim 0 ahead of a time,pls help~ Post 302434141 by netbanker on Thursday 1st of July 2010 12:31:34 PM
Old 07-01-2010
what about if I want to get the hour in ls -lrt?

Code:
abc*abc*/u01/app/abc/local/batch_log>ls -lrt
-rw-r--r--    1 oracle dba          348236 Jul 01 09:15 mon2.sh_100701.log


ls -lrt  mon2*.log | tail -1 |awk '{print $8}' | cut -f1 -d:

09

I need to show as 9 instead of 09

Last edited by Scott; 07-01-2010 at 02:24 PM.. Reason: Code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Experts Only! Hard Question Ahead!!!!

SunOS5.8 is a radical departure from SunOs4.X in many ways. one of the important differences is the handling of devices. Adding devices under SunOS4.x required a kernel reconfiguration, recompliation and reboot. Under SunOS5.X, this has changed with the ability to add some drivers on the fly.... (1 Reply)
Discussion started by: Foo49272
1 Replies

2. HP-UX

Read-ahead in HP-UX

One cool thing about unix is that it predicts disk blocks that you may need and tries to have them in core before you need them. Over the years, various unix vendors tried various algorithms to improve performance. HP has patented their latest algorithm... Multi-threaded Read Ahead Prediction... (0 Replies)
Discussion started by: Perderabo
0 Replies

3. UNIX for Advanced & Expert Users

urgent help needed!!in copying files to /tmp at boot time,pls help!

Hi all, I am trying to boot a an OS from RAM...(its a opensolaris based distro) For this i have picked up 2 key lib files that when copied to /tmp and mounted to respective places will do the job.. The sizes of these files combined comes upto 600mb.(i have 2gb ram) Now i have also located the... (0 Replies)
Discussion started by: wrapster
0 Replies

4. Shell Programming and Scripting

Pls Help me out ... I want to check process status at regular intervals of time

I want to check process status at regular interval of time ... so i ha wirtten this BUT its not working when i placed this peace of code in .sh .. please help me out #!/bin/sh w = ps -ef|grep processname | wc - l echo $w if ; then Banner "Proceesname Problem" else Banner " Running... (5 Replies)
Discussion started by: srinivasvandana
5 Replies

5. Shell Programming and Scripting

PERL look ahead and behind ...

I would like to search a router config file for "ip address $ip", once found, I want to grab the line just before that contains "interface $interfacetype" basically saying, 10.3.127.9 is assigned to "Loopback1" given the below as an example. interface Loopback1 ip address 10.3.127.9... (1 Reply)
Discussion started by: popeye
1 Replies

6. AIX

CIO/DIO and JFS2 read ahead

Hi Guys, I wonder if after enabling CIO/DIO at the filesystem level and assuming that CIO/DIO will bypass the JFS2 read ahead available when not using CIO/DIO my questionis what parameters I can play with to tune/improve the CIO in order to obtain similar performance for sequential reads (... (7 Replies)
Discussion started by: hariza
7 Replies

7. Shell Programming and Scripting

Start program in background (or start crontab ahead of time)

Hey! I'm working on a script that will add a user, create some configfiles, and add a crontab for the user. The crontab looks like the following: @reboot /home/user/program config.conf & I would like for this process to start at the end of my script under the corresponding username by... (0 Replies)
Discussion started by: noratx
0 Replies

8. Windows & DOS: Issues & Discussions

NFS Share Time an Hour Ahead

Time on unix server shows 8:00a CST Time on Windows 7 Box shows 8:00a CST However when you access an NFS share the time stamp on the files show an hour ahead? Talking about a newly created file shows an hour ahead so at 8:00a the file will show a time stamp of 9:00a CST the problem it... (1 Reply)
Discussion started by: Paul Standley
1 Replies

9. UNIX for Beginners Questions & Answers

Two days ahead

Hi, I have a code that will show one day ahead, how to make it show two days ahead p-dev1-db-tst:/$ day=$(TZ=IST-24 date +%d) p-dev1-db-tst:/$ echo $day 17 p-dev1-db-tst:/$ Regards, Adam (5 Replies)
Discussion started by: answer
5 Replies
show cached server(1m)													    show cached server(1m)

NAME
show cached server - Displays address information of a server in the local clerk's cache SYNOPSIS
show cached server name ARGUMENTS
A simple name for the cached server. The name can contain wildcard characters. DESCRIPTION
The show cached server command displays address information of a server in the local clerk's cache. The following list describes the valid attributes: The directory cell name The protocol sequence and network address of the server node Privilege Required You must have read permission to the clerk. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The following command displays all attributes of the cached server emv. cdscp> show cached server emv* SHOW CACHED NAMESERVER emv_udp AT 1991-10-15-15:56:56 Name = /.../emv.abc.com Tower = ncadg_ip_udp:14.20.14.32 Tower = ncacn_ip_tcp:14.20.14.32 SHOW CACHED NAMESERVER emv_tcp AT 1991-10-15-15:56:57 Name = /.../emv.abc.com Tower = ncadg_ip_udp:14.20.14.32 Tower = ncacn_ip_tcp:14.20.14.32 RELATED INFORMATION
Commands: clear cached server(1m), define cached server(1m) show cached server(1m)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy