Ubuntu :: BASH Script - How To Stop Loading Files At Arbitrary Number
Aug 9, 2010
I have the following code in bash script:
Code:
#!/bin/bash
COUNT=1
# bash until loop
until [$COUNT -gt 2]; do
pq A$COUNT [Pemptus].pq &
let COUNT=COUNT+1
done
I did this because I'm that much of a Progress Quest geek that I wanted to have a huge group on the online server, so I decided to make a script that would open all the files for me rather than having me do it manually. I created some characters with the boring name of A1, A2, etc. When I ran the above script, it went into a continuous loop and I had to halt it, then run sudo killall pq.exe to eliminate the 500 or so Progress Quest windows that popped open. Anyway, what is wrong with my script that I can't seem to get it to stop loading files at an arbitrary number? I want to get this part finished before I make any more boring named characters.
View 1 Replies
ADVERTISEMENT
Jan 29, 2010
I have no Bash skills but Im badly in need of a script to move the first 20,000 or whatever number of files from a directory containing over 200,000 files to a new directory. The problem is that I cant access the directory because its so large so I want to break it into chunks, but keep the files in order if possible. If you know of a script to meet my needs, please post it. Otherwise Ill post my fumblings with Bash until I find the right way to fix my problem.
View 14 Replies
View Related
Sep 18, 2010
I want to move files from a $SOURCEDIR to a $DESTBASE/$DESTDIR. Under $DESTBASE there are many directories, and I need to test beforehand if a file from $SOURCEDIR already exists in any of them.
This is obviously extremely slow, and the real use case involves dozens of dirs and thousands of files. Creating a temporary "index" file for the find command (instead of running it every iteration) speeds it up a little, but it's still very clumsy.
View 14 Replies
View Related
Mar 4, 2010
I want to generate a temporary random list from a directory of files and then determine the size of an arbitrary block of files from this list (say 1-25 or 26-50) and add their names to a file along with some other info for each name. I can generate a random list with file sizes like this: ls -l | sort -R | cut -d " " -f 6 but i'm not sure how to add up the sizes of just a certain block of these files and at the same time save the file names.
View 2 Replies
View Related
Feb 4, 2011
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
View 3 Replies
View Related
Apr 9, 2010
I've a folder named "lynx" in my desktop . It contains ebooks - pdfs,chms etc . The problem is sometimes when i open the folder in nautilus , the folder keep loading forever and sometimes it shows two or three files and keep on loading . But at some other times , folder contents are displayed just as any other folder(i.e normal ).
View 5 Replies
View Related
Mar 12, 2010
I have Windows XP and Linux Mint installed on my laptop.I'd like more than a few seconds to choose which OS I want to run.How do I fix this? Please explain it as if talking to a 6 year old as I'm new to Linux.
View 6 Replies
View Related
May 21, 2011
I am running 11.04 and would like to stop the loading of the parport and lp modules. I put entries in the /etc/modprobe.d/blacklist.conf file and ran update-initramfs -u. After a reboot lsmod shows both modules as being loaded.
View 4 Replies
View Related
Jun 9, 2010
I installed VSFTPD via: sudo gedit /etc/vsftpd.conf
I can start/stop using the following:
sudo /etc/init.d/vsftpd start
sudo /etc/init.d/vsftpd stop
By default, the daemon loads at boot but I don't want/need it to. I executed the following command thinking it would stop it from loading at boot code...
Can anyone tell me how to stop the VSFTPD daemon from loading at boot?
View 2 Replies
View Related
Oct 9, 2010
Today i downloded latest ubuntu 10.4.1 and installed from windows environment (so you know am new with ubuntu) after installing i tried updating ubuntu, including some kernel updates, but after updating ubuntu not loading up, it just show the loading page that all nothing change i tried recovery mode but i dint understood anything it show some command prompt. i had used 10.4.0 before.
View 3 Replies
View Related
Mar 27, 2010
I've recently installed Centos 5.3. Each time the pc starts KDE starts automaticaly, how can I remove that? I dont want to uninstall KDE, I just want to begin in the konsole and start KDE only if I need it.
View 5 Replies
View Related
Apr 30, 2010
Does anyone know how to stop ubuntu (when loading) looking for wifi signal's in the 5000000 khz range? I have a problem with other devices around my house that operate on this range of frequencies and it effects ubuntu while its booting, to the extent that it won�t load. My wireless router is on the 2000000 khz range therefore I only really need Ubuntu to look for devices on this range of frequencies. If anyone know a way to prevent Ubuntu looking on the 5000000 khz range by editing something I would be very greatful to know how to do this.
As at the moment I am having to boot about 5 times until it eventually decided to load. Sometimes the only way I can get in, is by going into recovery mode, dropping to terminal and typing in: "sudo gdm" and eventually I get it. Which is a right pain. Please see my previous post outlining my problem: [URL]
View 3 Replies
View Related
Jun 16, 2011
I am using the diff command with the -r option, to compare a large number of files and files in subdirectories. My main interest is to find out which files have been changed, and not what the actual changes are, and since a lot of files has been changed, it would be a lot easier to view the file names only. Is there and option for diff that might do this, or does there exist a similar tool/command that could do the job?
View 1 Replies
View Related
Jan 13, 2011
I'm trying to get an output of a file in numeric order. Basically I need the starting number and the ending number in sed this into anther file. The test2.lis file I'm just awk'ing for the first row and if its out of order put it in order so I can grab the first and last numbers. I'm sure I can do this all in an array. The first sed command gets rid of blank lines and outputs it to a file. Then I head and tail for the first and last number then I want to sed those numbers into a file that exsist.
[code]...
The error I get is:
sed: -e expression #1, char 24: unterminated `s' command.
View 13 Replies
View Related
Mar 17, 2011
I've these path:
Code:
xxx/yyy/zzz/0908/aaa/a.txt
xxx/yyy/zzz/0909/aaa/a.txt
xxx/yyy/zzz/0910/aaa/a.txt
fff/ggg/hhh/iii/jjj/0911/aaa/a.txt
fff/ggg/hhh/kkk/0912/aaa/a.txt
and I would like to extract only the number, so that I've get the result
Code:
0908
0909
0910
0911
0911
How can I do it in bash?
View 1 Replies
View Related
May 15, 2011
How can i get bc to subtract negative numbers?
View 10 Replies
View Related
Jun 14, 2011
Take this block of pseudocode:
Code:
for i in $list; do
<some statements>
if i > 5
exit
<more statements>
done
That is, want to terminate the iteration just after 5 iterations. A first problem, is that list is a string and not a number. It's all I can say, except to keep reading bash monster manual.
View 8 Replies
View Related
Dec 2, 2009
I want to make a very simple bash script to run a command for a user-specified number of seconds and then kill it. The purpose is to limit the amount of time the program runs.Example in pusedocode:
Code:
#!/bin/bash
#$1 is the user input number of seconds
[code]...
View 14 Replies
View Related
Feb 4, 2011
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
View 2 Replies
View Related
Jul 1, 2010
Is there a way to count the number of errors- an exit variable $? from one function?
The output from the exit variable (either erroneous or correct (1) or (0)) is it possible to add the erroneous one ups?
View 3 Replies
View Related
Aug 2, 2010
I have a file in the form below, and wish to replace each start line with an increasing number. So instead of:
Code:
start
content content
start
content content
start
[Code]....
After several searches and a bit of messing around, it's clear I'm missing something, so was wondering if anyone could offer any insight?
View 17 Replies
View Related
Aug 11, 2010
I would like to parse an input file in which there are two columns per each row. We want to see how many lines are duplicated where we define duplicate to be having the same second field and different first field. For instance if the input file looks like the following:
79874 13131
79873 12309
79820 13131
[code]...
View 10 Replies
View Related
Feb 17, 2010
When killing a process with kill -9 $PID &>/dev/null in a script, a message is still printed to the terminal after the next command terminates.
View 3 Replies
View Related
Mar 31, 2010
i would like to ask something very simple i hope for most off you but i couldn't find anything in other questions so specific...
So...i need a command to stop another command.
more specific i have to run airodump-ng and i want this command to stop after some seconds (or minutes) automatically....
View 6 Replies
View Related
Sep 12, 2011
Is there a way to catch or stop a Linux shut down after a reboot, halt or shutdown command has been entered?sudo shutdown -r +10 I should now have 10 minutes before the computer shuts down. If I change my mind and decide that I still want to continue running, how could I stop the shut down?
View 1 Replies
View Related
Mar 18, 2010
Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.
The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?
View 1 Replies
View Related
Jul 17, 2011
How do I get this loop to stop on each increment? This script does work but I would like it to stop at each increment, remember what the value of $n is, then continue until it gets to 7. I have worked so hard on this. My brain is hurting now.
[Code]...
View 2 Replies
View Related
Oct 11, 2010
sometimes you want to run a command every time computer boots up. In DOS there is "autoexec.bat" in windows - "Startup" menu and I'm sure that there is a similar thing exists for Ubuntu, but that's not what I'm after.These things above will run a command when a user logs on. I want to run a command when a pc boots up. This is not straightforward in Windows, but since I'm a windows guy I can do this. I can install a command as a service with srvany utility that will make sure it will execute on boot up.Now I want to do a similar thing in ubuntu. how do I edit startup scripts in ubuntu to add an arbitrary command? I need to run the command in the context of a particular user, so I normally do it like this:
Code:
sudo -u myServiceUser -i myService
But I want as little downtime as possible and sometimes it takes sometime to find out that there has been a reboot, get to a computer and run the command manually. If I could run this automatically on bootup I wouldn't have this problem.
View 2 Replies
View Related
Apr 9, 2011
I have Ubuntu 10.10 with three sessions, KDE, Gnome 3 and regular (along with its safe mode and all that jazz).
When i do: apt-get upgrade (after checking for updates) it will say something like 105 upgraded, 0 newly installed, 0 removed and 74 not upgraded....
How do I get rid of that 74 not upgraded or force them to upgrade?
View 2 Replies
View Related
Jan 22, 2010
I have 2 text files : file1.txt and file2.txt
cat file1.txt
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
cat file2.txt
2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2
I would like to join these 2 files. The result should look as follows :
cat joinedfile.txt
2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2
==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?
View 4 Replies
View Related