Script to restrict the length of the file name


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to restrict the length of the file name
# 1  
Old 12-09-2012
Script to restrict the length of the file name

i want to restrict the filename to 30 bytes.. that means if the file name is 20 bytes it should print the 30 byte name by taking the space as input

sample input :
unix_shellscripting.txt
unix_shellscripting .txt
# 2  
Old 12-10-2012
One really important point: you DO NOT want spaces in UNIX filenames. UNIX is not Windows, spaces in filenames are a problem for inexperienced or experienced shell programmers. Trailing spaces in an actual filename would horrible.

What are you trying to achieve , please tell us, but not how you want to do it.
# 3  
Old 12-10-2012
This User Gave Thanks to rdcwayx For This Post:
# 4  
Old 12-10-2012
@jim : its my requirement thats it..Smilie general casestudy as i am new to unix..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fixed Length file from a SQL script

Hi, I have a DB2 UDB 9.7 SQL script, as follows: I need to pass the script into Unix and generate a fixed length file from this. Can someone kindly provide a script to achieve it? SELECT CAST(COALESCE(CL_ID,'000000000') AS CHAR(9)) AS CL_ID ,STATUS... (5 Replies)
Discussion started by: ebsus
5 Replies

2. UNIX for Dummies Questions & Answers

How to restrict the execution of same script if it is running already in nohup?

Hi, How can i restrict the execution of same script if it is running already in nohup Thanks (1 Reply)
Discussion started by: ranabhavish
1 Replies

3. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

4. Linux

Restrict User to only execute the file.

Hi Gurus , I hope you are doing great . Other than owner of the file , OTHERS and GROUP should be restricted from read or write a file created by the owner. OTHERS and GROUP should be only allowed to execute the file. Thanks in advance. (8 Replies)
Discussion started by: palanisvr
8 Replies

5. SCO

Restrict user from breaking out of login script

I have a login script similar to where the user's shell in /etc/passwd is set to csh: echo "In .login" setenv SHELL /bin/csh /bin/sh -c trap "" 1 2 3 5 6 7 8 15 /path/to/application logout --------------------- however, even with the trap command the user is still able to... (1 Reply)
Discussion started by: kuliksco
1 Replies

6. Shell Programming and Scripting

Need awk script to compare 2 fields in fixed length file.

Need a script that manipulates a fixed length file that will compare 2 fields in that file and if they are equal write that line to a new file. i.e. If fields 87-93 = fields 119-125, then write the entire line to a new file. Do this for every line in the file. After we get only the fields... (1 Reply)
Discussion started by: Muga801
1 Replies

7. Linux

restrict file download not upload

hi everybody, How cud i stop downloading files from FTP and allow uploading files in FTP. Thanks & reg, (2 Replies)
Discussion started by: utpalsarkar
2 Replies

8. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

9. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

10. UNIX for Dummies Questions & Answers

restrict in file creation

Hi, how to restrict directories with one type of file creation. thanks and regards. (4 Replies)
Discussion started by: nk_bastia
4 Replies
Login or Register to Ask a Question