General :: Reduce Bash Script Length?

Jul 30, 2010

At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.code...

View 7 Replies


ADVERTISEMENT

General :: How To Reduce Bash Script Length

Mar 19, 2011

At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.Quote:and my question is do we need all the status codes necessary in this script..and is there any other way to reduce the code using any conditonal statements..code...

View 6 Replies View Related

General :: Bash Script To Read Csv File With Multiple Length Columns

Jul 27, 2011

I've searched everywhere and I can't come up with a good solution. For each line I need to find the average, min, and max. I've seen plenty of solutions where the number of columns is fixed, unfortunately for me these lines can get pretty large. My thought was to read each line individually into an array, loop through the array and find the avg, min, and max that way but i haven't had much luck. I can read each line using a while loop but I'm having trouble with the array part, or perhaps that's not the best solution?

View 14 Replies View Related

Server :: Reduce RAID5 Partition Sizes / Reduce The Size Of Md1 And Grow Md0?

Feb 14, 2010

I have a rack of four 1TB drives all partitioned identically with three primary partitions. On each drive

- the first partition is only 64MB;
- the second is a large 900GB partition and
- the last holds all the remaining space

mdadm has been used to set up
/dev/md0 - RAID1, comprised of /dev/sda1 and /dev/sdb1
/dev/md1 - RAID5, comprised of /dev/sda2, /dev/sdb2, /dev/sdc2, /dev/sdd2
/dev/md2 - RAID5, comprised of /dev/sda3, /dev/sdb3, /dev/sdc3, /dev/sdd3

OK, so it was a silly mistake to make - but I am now need to increase the size of /dev/md0. My thinking is to reduce the size of md1 so that I can grow md0.

On md1 I have two logical volumes. I've successfully reduced the size of the volume so that I can reduce the size of md1. Now I'm at the nervous stage; I can find little written on the topic of shrinking RAID5 arrays - and even if I do this I'm unsure if I can move partitions around to regain the space I so desire.

View 1 Replies View Related

Fedora :: Managed To Reduce The Logical Volume To Free Some Space But Cant Seem To Reduce The Physical Volume

Jan 1, 2010

so i have f12 installed on my hd with lvm using the whole extent of the HD , i want to reduce it so i can dual boot it with a windows system, i managed to reduce the logical volume to free some space, but i cant seem to reduce the physical volume, is this possible and how ?

View 2 Replies View Related

General :: Determine Mp3 Length By File Size?

Nov 16, 2010

Multiple dirs full of mp3s All strictly encoded with exactly the same parameters (CBR 128kbps, Joint-Stereo, etc) Is it possible to determine the total playing time (to within ~98% accuracy) by some formula based on the total file size? I say ~98% accurate since ID3 tags do consume a small amount of space.

View 3 Replies View Related

General :: Variable Length Console Prompt?

Jul 15, 2010

I have a question about the prompt. it is very easy to tune it for it to be colored and display path where you are etc. But my problem is that when the path is too long I would prefer the code line to be on the folowing line...

Ex
11:00 me@host a/short/path > ls -ltr ./stuff
11:00 me@host a/very/very/very/long/path
> ls -ltr ./stuff

and to be honnest as I am very new in LINUX I don't know how to do this...

View 7 Replies View Related

General :: Compare Columns Of Uneven Length?

Jan 20, 2011

I have a text file with 2 columns. Column A has 69,000 rows. Column B has 49,000 rows. Column A has our complete product list Column B has product list from Manufacturer 1 There are only certain/some rows which are common between 2 columns. and also, column B is not a subset of column A. Column A has extra entries and so does column B. I need to know, which rows from Column B, are common with Column A which rows from Column B are not common with Column A. Essentially I want to know from this list, how many of our products are from my manufacturer 1, how many does my manufacturer has which we dont carry.

How would I acheive this? My natural approach to solving this kind of obstacle is to reach for MS excel and use its lookup function, but its not working... Its taking forever and hanging up. since the file is so huge and probably my excel skills are really bad.

How can I do this from command line? I am looking for awk command if possible instead of sed since I am trying to pick up its syntax and usage etc. My thought process is, sort column A,B, for every row in A, lookup and output based on condition. Dont know if I am on the right track.

View 7 Replies View Related

General :: Delete Lines From File By Their's Length

Apr 27, 2010

i've got a file with sorted words - one on each line.How could it be possible to delete thouse lines that have words of length 1 or 2 (1-2 letters). I guess a good way it will be with AWK, n its fuction length(), but getting it, i dont know how to delete those very lines.

View 14 Replies View Related

General :: Set The Length Time Before Session Times Out Due To Inactivity?

Feb 20, 2011

I've just installed Ubuntu 10.04 and find that if I leave the machine for more than a couple minutes, it will automatically log me out. Instructions at other sites have indicated that session controls are to be found in System>Properties. But there is no Session in the list under Properties in Ubuntu 10.04. How can I control this feature so that I'm not having to constantly login every time I turn around? I've searched everywhere and can't find a solution.

View 3 Replies View Related

General :: Regex To Find Min / Max Length Words In File?

Jan 29, 2011

i am trying to find all 3 and 4-character length words in my file (which is huge and has alot of entries in it, a big fat wordlist!).My attempt with this regular expression (which I thought should work, found something on length search here: [URL]

cat sorted_noapostrophe.txt| grep '.{3,4}'

but it returns no results? Also to find any words starting with 'f' which are between 3 and 5 characters (inclusive) long, how can this be done?

View 4 Replies View Related

General :: Reduce LVM Messages In /var/log/debug?

Feb 21, 2011

/var/log/debug gets lots of messages any time an LVM snapshot is setup (lvcreate --size ${size}k --snapshot --name "$LVM_snapshot_device" "$LVM_device"). Here is a recent sample.

Code:
Feb 19 22:40:10 CW8 lvm[2163]: Loading config file: /etc/lvm/lvm.conf
Feb 19 22:40:10 CW8 lvm[2163]: Opened /etc/lvm/lvm.conf RO

[code]....

View 5 Replies View Related

General :: How To Reduce Load Average?

Feb 11, 2010

How to reduce the load average? I have two linux machines.. now my problem is that both the machines having same configuration and same processes are running in those two machines... But in one machine the load average is more than 3 and in other it is 0.5(when i am using top command).For this load average one machine(where load average is more) is slow when i am running application on it..

View 5 Replies View Related

General :: Reduce The Size Of A File?

Oct 31, 2010

How to reduce the size of a file. Is truncate related to this?

View 12 Replies View Related

General :: Implementing A Variable-length List Of Keywords In Mysql?

Sep 20, 2010

I'm having a hard time googling for answers because I keep using the word "keyword."

I've never really used any kind of database before, but I want to learn the basics, so I'm playing with it a little bit at work. What I want to do is make a database to hold information on various articles. For example, with columns for the title, author, and date. Those are all easy. The tricky part is that I'd also like to be able to label articles with keywords so I can search for certain topics.

Since there's no way to know ahead of time how many keywords, if any, each article might warrant, I'm not sure how to put this in database form. There's no variable-sized array data type. It seems sloppy to just list them all in a single VARCHAR column. Making several columns that may or may not be left null and putting one keyword in each seems wasteful.

View 2 Replies View Related

General :: Use To Save The .mp2 File As .mpg And Reduce The Size?

Aug 15, 2010

I have copied some vides from my camcorder and the size seems a bit excessive - 140mb for 3 mins! Is there a program I can use to save the .mp2 file as .mpg and reduce the size?

View 2 Replies View Related

General :: LV Reduced In VG Now / Reduce The FS And Partiton Size Of The PV?

Oct 18, 2010

I have a HDD that has 2 partitions. the 2nd partition is the VG and I want to reduce its size. I have reduced the Largest LV in the VG and now have free space in the VG. But, I am clueless on how to proceed to reduce the partiton size so that I can use it for another need.

When done, I expect to have 3 parttions total on the HDD. But first, I could some help in understanding the steps necessary for me to take, to move the free space out of the partition that has the Volume Group. Then, i can use fdisk on that 3rd partition for my needs.

I already know how to expand a Volume group by adding PVs, but, I do NOT know and cannot find how to reduce it to recover the free space in the VG to be used in a new partiton. (Better explained..."I want to reduce the physical partition size that the VG represents.)

View 5 Replies View Related

General :: Reduce /var Filesystem Size - Impact?

May 10, 2010

I need to create a temporary Filesystem and the only way to do it is to reduce /var and create a new filesystem 3GB size

Code:
df -h
/dev/mapper/VolGroup00-var
9.7G 1.5G 7.8G 16% /var

my question is according to google search I need to umount the filesystem point in order to reduce its size.... so it means I will require that nobody uses the system? since /var logs a lot information?

I also have the option to reduce /root but I think is more complicated.

so what are the precautions in order to reduce /var/?

View 6 Replies View Related

General :: Recover File Using FAT Cluster Chain Instead Of Using Stored Length In Its Table?

Feb 1, 2011

I'm trying to recover movie files from my TNT receiver hard drive but it corrupts its FAT32 allocation table (crappy cheap device...)

Using dosfsck is useless because the correct file length is the cluster length, not the (shorter) one in the table, and dosfsck only proposes to shorten the file, which I won't do.

Question: how to recover a file using the FAT cluster chain instead of using the stored length in the FAT table?

View 1 Replies View Related

General :: LVM2 On F10 - Reduce LVM Size And Remove 2 HDDs?

Oct 15, 2009

I have the following HDDs in an LVM2 configuration on an F10 box running Mythtv :-

# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [297.88 GB / 0 free]
PV /dev/sdd1 VG VolGroup00 lvm2 [931.50 GB / 0 free]
PV /dev/sdb1 VG VolGroup00 lvm2 [298.06 GB / 0 free]
PV /dev/sdc1 VG VolGroup00 lvm2 [931.50 GB / 0 free]
Total: 4 [2.40 TB] / in use: 4 [2.40 TB] / in no VG: 0 [0 ]

The system never uses more than about 250GB of HDD at any one time, so I would like to remove /dev/sdd1 and /dev/sdc1 from the LV and then from the machine and leave /dev/sda and /dev/sdb alone.

Does anyone know that if I use the command "system-config-lvm" to reduce the total LVM size to say 580GB, whether all data is preserved (I don't have any way at this stage to backup up 250GB of data, unless I buy more HDDs and that is the whole point of this exercise anyway - remove the two terrabyte drives to be used as backup disks).

Once I am happy that the data is safe, I will use "pvmove" and "vgreduce" to remove both terrabyte drives.

View 8 Replies View Related

General :: Sed/awk/grep Search For Number String Of Variable Length In Text File?

Jan 19, 2010

I need to search a text file for a string of numbers which are different lengths, and always are between number=" and " like:

number="1234567890"
number="22390"

I need to grab those numbers and pipe each one to a line in a file. I've already tried something with awk and that didn't seem to work.

View 10 Replies View Related

General :: Reduce Fedora's Disk Size In VMware Player?

Jan 3, 2011

I'm new to Fedora 14, vmware player. After getting Fedora up and running in VMware player. The disk size was 2.7 GB. After three hours of working with it, the disk size has bloated to 4.3 GB. I havent added software to account for the near doubling in size. How do I reduce the size back to 2.7GB range or lower. Im new to Fedora and superuser controls. Im removing more software than adding software. Is this a VMWARE problem or Fedora problem?

View 1 Replies View Related

General :: Embedded Webserver (mysql) On A Compact Flash: Reduce Read / Write Operations?

Jul 7, 2011

I've developed a tiny webserver for home automation out of an ALIX 1D, and based on a debian lenny. It runs very smoothly and is now able to operate quite a lot of different equipment from a webapp. But i'm not sure how I should handle the compact flash, regarding read/write limitations. From what I've read the partitioning should be ext2, which would disallow the journalisation of the system. A utility to 'flatten' the repartition of write cycles exists, would it be relevant to use if the partition is ext2 ?

I will also disable all logging in execution mode (a debug mode will provide the logs). Is there any other parameters I have to take into account for maximum reliability (i.e. does the system randomly write in some files for various and potentially turned off purposes)? As for the mysql database, it's not important data, and it's actually reconstructed every time the server boots. Given this, is there a way to store the db in RAM rather than in a file? I'm not sure it's the right place to ask, but I sometimes see redirection to here from stack overflow.

View 2 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

General :: Invalid ACPI: Invalid PBLK Length [5] During Debian Boot

Sep 20, 2010

I installed Debian 5.03 Lenny successfully on my machine. I got this error during boot: ACPI : invalid PBLK length [5]. After that the Operating System boots properly and starts normally. What does this error statement mean? Is it safe to work with this installation despite this error?

View 1 Replies View Related

Red Hat / Fedora :: Nul Files Appearing With Zero Length

Apr 14, 2010

I am working on a system that uses Red Hat Client 5.3. Files keep being created all over the system. They are all named nul and are zero length. We use a common login and thy are owned by this login account. I have grep'd the entire system looking for some code that would be writing these files but nothing has come up.

View 2 Replies View Related

Software :: Get Received UDP Packet Length?

Feb 12, 2010

How to get the length of received UDP packet? Using wireshark I could see the correct length of datagram. How can I print this value in my simple udp server program? I am receiving binary data (Non printable ascii characters as a data) So I can not use strlen(buf) which throws incorrect length.

Code:
if (ret=recvfrom(s, buf, BUFLEN, 0, (struct sockaddr *)&si_other, &slen)!=-1){
error = ioctl(s, FIONREAD, &value);
printf(" from ioctl UDP packet length is : %d error is : %d
", value, error);
code....

View 1 Replies View Related

Programming :: How To Find Array Length In C

Jul 3, 2011

I would like to know how can I find array length in C .I have array of structure and I want to sent it to different functions and I want to have it's length (number of elements) each time I want to use it and I don't like to use any additional variable to pass the function for each of arrays that I pass to function.
How can I do that?

View 5 Replies View Related

Programming :: Calculate Length Of My Array?

Jun 30, 2010

I want to calculate length of my array, say Unix here.

Code:
[linux1@HMLINUX1 abc]$ declare -a Unix=('Debian' 'Red Hat' 'Suse' 'Fedora');
[linux1@HMLINUX1 abc]$
[linux1@HMLINUX1 abc]$ echo ${#Unix[@]}
5

This should be ideally 4, but somehow it is showing as 5. However, when I am removing the space as RedHat instead of Red Hat, it is working perfectly.

Code:
[linux1@HMLINUX1 abc]$ declare -a Unix=('Debian' 'Redhat' 'Suse' 'Fedora');
[linux1@HMLINUX1 abc]$ echo ${#names[@]}
4

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved