I have up until now been able to use the add-apt-repository command without issue but right now it keeps returning an IndexError.
The error is below:
Code:
Select allx@y:~$ sudo add-apt-repository ppa:/kilian/f.lux Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 122, in <module> shortcut = shortcut_handler(line)
[Code] ....
IndexError: string index out of range
I have tried using the command with an empty ppa (just sudo add-apt-repository ppa:) but that comes with the same error. Googling the issue only brought up some bugreports of a month back, and I've used the command with success a few days ago.
I tried to find out how awk works with multiline strings. I found this. I hope it will be useful for somebody. 1. I know that awk can searches simple patterns like '/^one/'
Code: s="one two three" echo $s | awk '/^one/'
2. I know that "Awk can handle multiline records by specifying the field separator to be a newline and set the record separator to an empty string." I've found it here
I am having a little trouble with a Bash shell script that I am working on. It is intended to read the information out of a gedcom genealogy file and determine who has lived in a particular area and output a report based upon who lived in a given area (like the different sections of a bygdebok for example). I am having a number of issues.
1) I can't seem to figure out how to get a variable to work as the index of an array. For example, I am trying to use the variable $individual to count which individual is being read in from the .ged file, and once that is figured out, next I will read in the individual's name, so I would like to create an array of names using the variable
Code: $individual as the index of the array. However, if I try the code Code: name[$individual]=$lineoftext;
[Code]....
I included only the last few lines of output as to not take up too much space because the output goes on forever, but you get the point from the example. This output has nothing to do with what the final output of the program is intended to be like. It is merely a test to prove that the 2 variables in question are getting their date loaded in properly.
My system is giving me a low space on filesystem warning. When I run disk analyser, it seems that /var/lib/apt-xapian-index is using 97% of it!! That's 8.9GB. I found another post which explained that each time this package runs it builds a new index set, and how to make it only update new packages. I made that change, but this doesn't release the 8.9GB that I guess can just be cleared down somehow...
I hope it can be cleared down anyway. How to clear all this down? I do want the package to remain running on the system, I just want to clean it up and release all that space. I'm on Lucid, I also saw the warning on Jaunty but it went away after upgrade to Lucid... now it's happening again, I can't ignore and hope it goes away for ever!
I need to call a function that takes a string array as argument, declared like this:Code:int someFunction(/* some parameters... */, const char* s[]);I'd like to know how to allocate memory for the string array. I know a string is an array of chars and an array is a pointer to the first element, then a string array should simply be a two dimensional char array. But is it a single memory block where all strings are stored consecutively?? Or is it a base vector where each element is a pointer to a separate memory block that contains a single string?More specifically: should I malloc() a single memory block large enough for all the strings? or should I allocate separate blocks for each string plus an extra one for the base vector?
I have the following function that does not iterate through the array I want to be able to do some manipulation on each element in the array[@].it appears the below array has only one item in the array whereas i want the array to have 3 items hence the loop three times printing the message Any ideas why this is not happening ?
I want to put a string, such as the one found in the image, into an array that will later be chopped into individual words and put into another array of individual words found in the initial string. (or, perhaps, I would be able to do that initially, but for now, that is the goal)My question is, how can I do that without using quotation marks?
I have a sed match that matches for certain string of a regex expression:
Code: tname=$(echo "$contents" | sed -n 'some pattern')
How do I match for multiple strings in the $contents and return them as an array? for example
Code: contents="this is a text, just to match patterns, here is another text to be matched" the sed func would be able to recognize both "text"s, but only one is outputted?
Possible to put it in an array? so ${bar[0]} gives one and ${bar[1]} gives another
This may be a basic bash array/string operation related question, but I couldn't find any direct answer. So here it goes:I have a lot of data sorted in various directories. All directories need same processing except for a special group of directories. I have a symbolic link of the script in discussion in each directory. I want the script to get the name of the current directory, check if that belongs to special group and do specific operations.So I get the name of the directory
Code: mm=`basename `pwd`` Now the the group of directories that needs something different to be done, contains these
I have a tsv file that I'm trying to break down, line by line, then column by column so to speak. The file is a list of exported usernames, passwords, and display names from an email server, I need each separate to be used in other commands to provision the new server. My problem is, each display name contains a space, as usual with people's names. Here is the script for reference:
Code:
while read line do uname=`echo $line | awk '{ print $1 }' >> works` pass=`echo $line | awk '{ print $2 }' >> works`
Ok, as the title indicates I have a RAID5 array with 4 500GB SATA drives. This is the only drive configuration on the system (i.e. the OS also resides in the RAID array). I'm running CentOS 5 and need to know how to go about increacing the space in the RAID array by replacing the drives with 4 1TB drives.
Is there any inbuilt function other than strncmp which can evaluate a string.my requirement is " if all 10 values are spaces print 1 else if it contains some values print 2 else print 3.if i use strlen, even space is counted.I know that i can evaluate using for loop by checking 1 by 1 char, and using strcmp function, is there any other way?
I have a PC with Windows 2000 Pro installed in an NTFS partition of 60GB. My rest hard disk (500GB) is empty, no partition at all. When I run Ubuntu 10.04 installation after step number 3 I get a weird step number 4 showing prepare partitions with an empty array and no available command button at the bottom! So I can not create any partition... Also in step 4 I never see the "prepare disk space" menu. If I use a 9.04 Ubuntu CD and I try to install I get every menu fine as expected. I even tried the 10.04 CD to another PC with Windows XP PRO and the installer worked as expected for partitions.