Sponsored Content
Full Discussion: How can i truncate filenmes?
Top Forums UNIX for Dummies Questions & Answers How can i truncate filenmes? Post 302129516 by matrixmadhan on Tuesday 31st of July 2007 09:32:02 AM
Old 07-31-2007
this,

Code:
echo "abcdXXXXXX.pqrXXXXX.asc" | awk -F"." '{ for ( i=1; i<NF; i++) { printf "%s", $i; if ( i < NF - 1 ) { printf "%s", "." } } printf "\n" }'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Truncate what is It?

what does this command do ? as in does this command just make sure everything in the file is executed? or does it flush the file? Actually this is used on a file in a progress database but I believe it is a unix command? (2 Replies)
Discussion started by: rocker40
2 Replies

2. UNIX for Dummies Questions & Answers

truncate wtmp

I have AIX5.1 I have been trying to learn how to truncate the /var/adm/wtmp file. I have seen several things on google actually but don't quite understand. I also searched your forums but couldn't find it. one says this ">/var/adm/wtmp Is that all I do? I have a seperate question also. I was... (1 Reply)
Discussion started by: rocker40
1 Replies

3. Shell Programming and Scripting

How to truncate as filesize?

Hello everybody it's me again. I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence? in the process are an... (1 Reply)
Discussion started by: Lestat
1 Replies

4. Shell Programming and Scripting

Truncate File contain

I have one file which first line is blank and second line has some data. $cat filename output: 30-MAY-07 I want to store 30-MAY-07 value in one variable. for that I wrote var="`head -2 filename`" It will give that result but I want to truncate the first line which is blank. plz help. (2 Replies)
Discussion started by: rinku
2 Replies

5. UNIX for Advanced & Expert Users

*** Truncate certain field ***

I have a file in which I need to truncate 15th field to have only one character like Put --> P and if i have no value in 15th field, it should be "O" (Other) would really appreciate the reponses, thnx in advance:b: (2 Replies)
Discussion started by: sannmayaz
2 Replies

6. Shell Programming and Scripting

Truncate table

Hi In unix able to connect to oracle database and create table ,when rerun ,if table exist ,truncate that table.Any idea how to do that a.sh ---- sqlplus -s datadmin/password <<EOF create table xx(col1 number, col2... ); exit; EOF I... (1 Reply)
Discussion started by: mohan705
1 Replies

7. Shell Programming and Scripting

Truncate file name to 40 characters

Hello all. I would like to make a script (or two shell scripts) that will do the following. I need the maximum file name and directory name to be 38 characters long. As well, if shortening the file name ends up making all of the files in that directory have the same name, then I would like... (9 Replies)
Discussion started by: marcozd
9 Replies

8. Shell Programming and Scripting

Truncate string variable

Hi, I want to truncate a string variable, returned in the script. In perl I used the below and it worked. BRNo=BR12345 $BR = substr($BRNo, 2, 7) How can I do it in sh. Thanks ! (8 Replies)
Discussion started by: script2010
8 Replies

9. Shell Programming and Scripting

Truncate terminal output

Hello Using BASH under Ubuntu 10.4 lts + XMonad My script is almost perfect but i'm stuck at the last hurdle: I need a sort of modified 'echo' which truncates its output to the width of the terminal I can find the terminal's width with 'stty size' but i dont know how to then convert input... (2 Replies)
Discussion started by: scyptnex
2 Replies

10. UNIX for Dummies Questions & Answers

recover the truncate file

hi All, how to recover the truncate file in unix. Thanks!:wall: (2 Replies)
Discussion started by: krbala1985
2 Replies
MPATH_PERSISTENT_RESERVE_OUT(3) 			     Library Functions Manual				   MPATH_PERSISTENT_RESERVE_OUT(3)

NAME
mpath_persistent_reserve_out SYNOPSIS
#include <mpath_persist.h> int mpath_persistent_reserve_out (int fd, int rq_servact, struct prin_resp *resp, int noisy, int verbose) DESCRIPTION
The function in the mpath_persistent_reserve_out() sends PR OUT command to the DM device and gets the response. Parameters: fd The file descriptor of a multipath device. Input argument. rq_servact PROUT command service action. Input argument rq_scope Persistent reservation scope. The value should be always LU_SCOPE (0h). rq_type Persistent reservation type. The valid values of persistent reservation types are 5h (Write exclusive - registrants only) 6h (Exclusive access - registrants only) 7h (Write exclusive - All registrants) 8h (Exclusive access - All registrants). paramp PROUT command parameter data. The paramp is a struct which describes PROUT parameter list. Caller should manage the memory alloca- tion of this structure. noisy Turn on debugging trace: Input argument. 0->Disable, 1->Enable. verbose Set verbosity level. Input argument. value: 0 to 3. 0->Crits and Errors, 1->Warnings, 2->Info, 3->Debug RETURNS
MPATH_PR_SUCCESS if PR command successful else returns any one of the status mentioned below MPATH_PR_SYNTAX_ERROR if syntax error or invalid parameter MPATH_PR_SENSE_NOT_READY if command fails with [sk,asc,ascq: 0x2,*,*] MPATH_PR_SENSE_MEDIUM_ERROR if command fails with [sk,asc,ascq: 0x3,*,*] MPATH_PR_SENSE_HARDWARE_ERROR if command fails with [sk,asc,ascq: 0x4,*,*] MPATH_PR_SENSE_INVALID_OP if command fails with [sk,asc,ascq: 0x5,0x20,0x0] MPATH_PR_ILLEGAL_REQ if command fails with [sk,asc,ascq: 0x5,*,*] MPATH_PR_SENSE_UNIT_ATTENTION if command fails with [sk,asc,ascq: 0x6,*,*] MPATH_PR_SENSE_ABORTED_COMMAND if command fails with [sk,asc,ascq: 0xb,*,*] MPATH_PR_NO_SENSE if command fails with [sk,asc,ascq: 0x0,*,*] MPATH_PR_SENSE_MALFORMED if command fails with SCSI command malformed MPATH_PR_RESERV_CONFLICT if command fails with reservation conflict MPATH_PR_FILE_ERROR if command fails while accessing file (device node) problems(e.g. not found) MPATH_PR_DMMP_ERROR if Device Mapper related error.(e.g Error in getting dm info) MPATH_PR_OTHER if other error/warning has occurred(e.g transport or driver error) SEE ALSO
mpath_persistent_reserve_in mpathpersist /usr/share/doc/mpathpersist/README Linux Manpage 2011-04-08 MPATH_PERSISTENT_RESERVE_OUT(3)
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy