command to obtain lrecl


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers command to obtain lrecl
# 1  
Old 07-07-2004
Error command to obtain lrecl

I'd want to know the command to obtain the lrecl number of a file.
# 2  
Old 07-07-2004
That information is metadata that is NOT stored in the file system.

If the file is carriage-control with fixed record length you could try something like this:
Code:
#!/bin/ksh
# $1 is paramter = file name
let bytes=`wc -c $1`
let records=`wc -l $1`
let lrecl=$bytes/$records
echo "$lrecl"

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to obtain info from whois?

Hello, do you know any clever way to get information whether certain domain name become avaialble for registration from bash script? Would be good to check for the availability like every 100miliseconds, i want to catch domain. (1 Reply)
Discussion started by: postcd
1 Replies

2. Shell Programming and Scripting

how to obtain a variable between subroutines

#!/usr/bin/bash sub1 () { for ((i=0;i<10;i++)) do export a=$i; echo "value of a is $a"; sleep 1 done } sub1 & sub2 () { for ((j=0;j<10;j++)) do echo "value of a is $a"; sleep 1 done } (5 Replies)
Discussion started by: Arun_Linux
5 Replies

3. UNIX for Dummies Questions & Answers

How to use the join command to obtain tab delimited text files as an output?

How do you use the join command and obtain tab delimited text files as an output? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

4. Shell Programming and Scripting

Expect script: obtain the exit code of remote command

Hi all, I'm trying to run the sipp simulator in crontab but after some attempt I came to the conclusion that for some reason this isn't possible (maybe due to sipp interactive nature). This is confirmed by these posts. Now I'm trying to launch sipp from an expect script that runs in crontab. ... (0 Replies)
Discussion started by: Evan
0 Replies

5. Shell Programming and Scripting

how to obtain date and day of the week from `date` command

Hi, does anybody know how to format `date` command correctly to return the day of the week? Thanks -A I work in ksh.... (1 Reply)
Discussion started by: aoussenko
1 Replies

6. UNIX for Dummies Questions & Answers

Date command to obtain the last month is not working correctly..

Hello, I could not find the exactly same post here.. so I will explain what I did to get the last month using date command. I used date +%Y-%m -d "-1 months" to get the last month. However, the returned value of above command on 2009/10/31 was 2009 10 and not 2009 09.. and the... (9 Replies)
Discussion started by: tigersk
9 Replies

7. UNIX for Dummies Questions & Answers

How to obtain list of users ?

How to obtain list of users found in /home/ and append it to a file. (7 Replies)
Discussion started by: bobby36
7 Replies

8. HP-UX

How can I obtain Hpux?

Hi, How can I obtain Hpux? Thanks (4 Replies)
Discussion started by: arabidi
4 Replies

9. HP-UX

Obtain Memory on HP UNIX

Hi, Does anyone know an easy way of getting the memory usage on a UNIX box? I basically want to find the total % available/in use. Running vmstat gives me 'avm' and 'free' but come in bytes and not percents. Didn't see a switch in sar that just gave me the memory stats similar to Sun's -r... (4 Replies)
Discussion started by: jonesin
4 Replies

10. UNIX for Dummies Questions & Answers

Where to obtain FreeBSD?

Anyone help ! From where can I download a free version of FreeBSD ? I am trying to teach myself this OS, have all the documentation needed, but am short the OS itself. If anyone can send me a link, I would be most appreciative ! (3 Replies)
Discussion started by: treborwallace
3 Replies
Login or Register to Ask a Question