Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-07-2006, 03:16 AM
|
#1
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Rep:
|
do a calculation for block sice
Hi
I want to write a small script to get the block size in Bytes in a file system.
FS=/vol1
du -bs $FS = value assign to FSBY
du -s $FS = value asinine to FSBL
and do
FSBY/FSBY= "one block in bytes"
and assign that value the result to a variable for further processing
Regards
Asanka
|
|
|
|
07-07-2006, 03:33 AM
|
#2
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Did you read man bash ?
FSBY=$(du -bs $FS)
FSBL=$(du -s $FS)
echo $((FSBY/FSBL))
|
|
|
|
07-09-2006, 05:49 AM
|
#3
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
Hi Raskin
I am realy new to all this
regards
Asanka
|
|
|
|
07-09-2006, 11:17 AM
|
#4
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
This doesn't make man bash (and info bash) less valuable reading for everyone who wants to write useful scripts in Bourne again shell...
|
|
|
|
07-10-2006, 09:33 PM
|
#5
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
hi raskin
Can we migrate windows 2003 AD to samba 3 with LDAP on linux
regards
Asanka
|
|
|
|
07-11-2006, 12:22 AM
|
#6
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Not my topic. Do ask in a separate thread with samba in header.
|
|
|
|
07-11-2006, 01:09 AM
|
#7
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
I did but ????????????????
|
|
|
|
07-11-2006, 04:47 AM
|
#8
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Maybe nobody now reading is sure that it is impossible - or just nobody tried.. Then ask about good manuals on samba/LDAP and try yourself. I really have only one experience of samba - running smbmount (yes, client only) on FreeBSD 3 years (as I remember) ago...
|
|
|
|
07-12-2006, 12:48 AM
|
#9
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
Hay raskin
when you do du the output is proceeded by a dot. How can I only get the numeric value of du output
Regards
Asanka
|
|
|
|
07-12-2006, 01:35 AM
|
#10
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Didn't understand. Do you wnat something like
du -s "$PATH" | sed -e 's/\s.*//'
?
|
|
|
|
07-12-2006, 01:51 AM
|
#11
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
When I do du -s
25176 .
how can I only get teh 25176 with out the "." and spaces
Regards
Asanka
|
|
|
|
07-12-2006, 01:58 AM
|
#12
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Did you test my code? It should work.
|
|
|
|
07-12-2006, 02:27 AM
|
#13
|
|
Member
Registered: Jan 2006
Location: Sri Lanka
Posts: 457
Original Poster
Rep:
|
Sorry I did not chack
yes it works
Thank your raskin
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:41 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|