General :: CLI Commands To Generate Random Result From Specified List?

Jul 20, 2011

List of 77 lines with the names of movies. For ease, let's say it's in a text file. What I want is a command line argument I can pass that'll read each line and pick one of those 77 lines at random, except I can't figure out how to do this. Is there a program I can just pipe the output of 'cat listofmovies.txt' to?

View 13 Replies


ADVERTISEMENT

General :: Generate Random List And Determine Size Of Arbitrary Block Of Files In Dir?

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

General :: Generate Random Number Either 1 Or 0?

Jan 21, 2010

Not only that but I need tons and tons of them generated, and I need it to be totally random each time.

Code:
matthew@mvm:/h/misc> cat a
#!/bin/bash
for i in {1..5}; do
echo $RANDOM

[Code]....

There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.

The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].

View 4 Replies View Related

Debian Programming :: Generate SQL Result Into XML

Dec 2, 2014

How do I generate sql result into xml ? Tried this way (shown below), but it generates all data into single column.

Code: Select allgenerate_xml()
{
        f1=_tmp1
        f2=_tmp2
        cat $SQL_QUERY_OUT |sed -e 's/^"//g;s/"$//g;s/","/|/g'|tr '|' ' ' > $f1
        [ -e $SQL_QUERY_OUT ] && rm $SQL_QUERY_OUT

[code]....

View 2 Replies View Related

General :: Generate List Of All Available Man Pages On System?

Nov 5, 2010

How to generate a list of all available man pages on a system?

View 4 Replies View Related

Software :: Generate Random Letters Only?

Aug 24, 2010

I have this: Code: dd if=/dev/urandom count=128 bs=1 2>&1 | md5 | cut -b-10 But I only want it to have letters and no numbers. What can I do for this?

View 13 Replies View Related

Programming :: Using /dev/random To Generate Double?

Mar 6, 2010

I need to generate random numbers using /dev/random in C. The numbers should be of type double (64-bit floating point).The functionality should be equal to linux command "od -An -N8 -t fD /dev/random", but written in C.The prototype should be "double drand(void);".

View 7 Replies View Related

Programming :: Script To Generate Random Dates?

Aug 3, 2010

A script to generate random dates. It uses the year range 2006-2009, and truncates every month of the year to an ordinary February's 28 days, but otherwise it's pretty solid and safe.

Code:
spate=1
while [ $spate -le 120 ]

[code]....

View 1 Replies View Related

OpenSUSE :: Running Dos Commands From Suse On Windows And Getting Back The Result?

Sep 15, 2011

My application requires that I run dos commands on a Windows desktop which is in the same network as the Suse server. The command needs to be initiated from my Suse serverand I need to get the result of the command from Windows on my Suse server

View 9 Replies View Related

General :: Making A ('list'?) Of Commands To Run?

Dec 11, 2010

i have a java program and to run it, i have to go into terminal and typecd <where the file is>java -jar <filename>.jarthis works fine, but is there a way to make a shortcut/small program to do this for me when i double click?

View 3 Replies View Related

Ubuntu One :: Got Empty Result For Devices List?

May 11, 2010

I get ubuntu 10.04 LTS installed on my PC and laptop , and I tried ubuntu one.It worked and I want to have a test, so I removed the two devices that already subscribed to my ubuntu one account, after that, I found I can't get them subscribed back.Everytime I start ubuntu one preference , I'll get the error message: got empty result for devices list.How can I add my two devices back to my ubuntu one account (I googled a lot and found that someone pointed that delete the ubuntu one's key will work, so if this is the right solution, how to delete it?

View 5 Replies View Related

General :: How To List Folders Using Bash Commands

Sep 14, 2011

Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )

View 3 Replies View Related

General :: Capture A List Of All Installed Commands?

Jan 30, 2010

if I open a terminal and hit [TAB] [TAB] it will display "Display all 2583 possibilities? (y or n) ". If I press y is there a way to capture the output and write it to a file? Not like it is a command so I can't just use a redirect to a file? If not I guess I could just do an ls on all locations of $PATH and capture that to a file.

View 7 Replies View Related

General :: SSH Tunnel Commands To List Active/disconnect?

Apr 1, 2010

I've just started experimenting with SSH tunnels. I wanted a way to connect to MySQL on our website VPS but wanted the connection encrypted rather than just using PHP's mysql_connect() function and connecting to the remote IP. This seems to be working great. I'm also looking into autossh to make sure that the tunnel gets reconnected when it drops.is there a command/utility that can list the currently active SSH tunnels? Be great if there was a way of terminating an active tunnel through a command as well. Or is it a case of manually digging through the process list and killing the specific PID like I have been?

View 1 Replies View Related

Debian :: Generate Directory List With Exclusions?

Aug 18, 2011

I'm trying to generate a list of my music directory folder structure WITHOUT the files included. I have my music directory set up in a hierarchy of Artist>Album>Files, and I just want to generate a list of the folders because that will, in effect, output a list of what albums I have by what artists, which is ultimately what I'm after. I did some looking on the internet through various forums over the past few days and found two ideas that looked promising, but ended up being not exactly what I needed. The first was to generate a .txt file based off of a shell ls command:

ls -R [music directory name] >> ~/mymusiclist.txt

That's great, except that it also includes the 40,000+ individual music files by name. I'm not about to invest that much time editing the files out of the list when I know there has to be an easier way.The second idea I came upon involved using the extglob function. I tried enabling extglob and using it to input a "negative wildcard" into the above method to remove anything .mp3 from the returned list, but extglob didn't play well in that context. I'm not a command line wizard, so it's entirely possible that I'm missing something fairly obvious. In fact, I'm sure I am. So this is a great opportunity for me to learn something new. If anybody knows of a command line way to do this, I'd love to know it. Or, even better, if anybody knows of an app that can do this, even better. I'm not above installing a secondary music player just to import the library once and get my list.

View 3 Replies View Related

Ubuntu :: Generate A List With Files And Folders?

Feb 2, 2011

if there is an application available to generate a list with files and folders from a location, like a hard drive or a folder? The list could be in any format, even a text file would be just fine.

View 3 Replies View Related

General :: Using The Expect And Send To Execute List Of Commands Inside A File?

Feb 2, 2011

i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no problem, but when i try to insert these commands into the send i face problem. here is the basic code

#!/bin/bash
read msisdn < input
string="ZZZZ:MSISDN=$msisdn;"

[code]....

i can make external loop inside the Bash which read the input file and issue the command and then telnet and execute, but this will make the script connects and disconnects again for each line which cause high load on that server and hardwar problem. i am wondering if there is an option inside the expect interperter which makes the send read directly from a file... somthing like this:

expect "<"
send "input-filename
"
expect "<"
expect eof

View 1 Replies View Related

Programming :: Reading Lines To An Array And Generate Dynamic Zenity List?

May 18, 2011

explanation what I want to do exactly:I have a textfile which looks for instance like this:

file.txt:
...
something=else to do

[code]....

View 14 Replies View Related

Ubuntu Installation :: E: Internal Error: Couldn't Generate List Of Packages To Download

Nov 16, 2010

My problem is that I am unable to do a routine upgrade of packages. When I try to perform an upgrade, the following occurs:

Code:

$ sudo aptitude dist-upgrade
Reading package lists... Done
Building dependency tree

[code]....

If I try to install another package, I get the following message:

Code:

E: I wasn't able to locate file for the tzdata-java package. This might mean you need to manually fix this package.
E: I wasn't able to locate file for the tzdata-java package. This might mean you need to manually fix this package.
E: Internal error: couldn't generate list of packages to download

View 9 Replies View Related

Ubuntu :: Random Screensavers From List?

Apr 28, 2010

I was wondering if there is an application that allows the computer to chose a screensaver at random from a specific list that you make. I know that you can make the computer choose any screensaver at random, but I want it to choose only the ones I specify at random. I have about 6 screensavers that I want it to choose at random.

View 4 Replies View Related

Software :: Finding A Program To Display Random Words From List?

Apr 22, 2011

Is there a Linux program I can use to display random words from a list? By entering words in a spreadsheet and then sorting the list in alphabetical order, I made a list of new vocabulary words for myself to memorize, and wondered whether I could make random words from the list display on the screen daily. I know I could write a program to do that if I knew programming, but I don't.

View 10 Replies View Related

Ubuntu :: A List Of Basic Commands?

Nov 9, 2010

From where can i get a list of basic commands that can be run from the terminal from ubuntu ?for example:nautilusmounttopapt-get

View 9 Replies View Related

Hardware :: Commands To See The User List?

Dec 24, 2010

I want to see the users list and the permissions of the users when i logged in a root and how to change the permissions of the users. 2.How to change the permissions for the commands. example:when i logged with my other user account(not with root user) i dont have a permission to use the move(mv) command. #mv filename /backup my error : Permission denied. I need to know how we can set the permissions for the commands even.

View 1 Replies View Related

CentOS 5 :: Get A List Of Terminal Commands?

Jun 12, 2010

I would like to find documentation on all the available terminal commands and syntax for CentOS 5.

I have googled and looked through the wiki and found nothing about the terminal to my ability.

As for what I am referencing by commands:

sudo: I get the su means super user

cd: change directory

rm: remove, I don't know how to remove folders.

General navigation and using the terminal to create files/directories/open file editor/etc..

View 3 Replies View Related

CentOS 5 :: Getting The List Of Commands For Vi Editor?

Dec 22, 2010

For example, when I want to have an identical line to the above line, I must press "yy" and then P (or p). Could somebody give me the list of such commands.

View 6 Replies View Related

Ubuntu :: Find A Complete List Of Commands For The Terminal?

Jan 24, 2010

Were can I find a complete list of commands for the terminal in ubuntu linux 9.10

View 9 Replies View Related

Ubuntu Servers :: Cannot Find The List Of CLI / Console Commands For Deluge

Jun 27, 2011

I for the life of me can not find the list of CLI/console commands for Deluge. I'm trying to at least find the command to change global download speed.

View 3 Replies View Related

General :: Rpm -qa Doesn't Return A Result

Jul 3, 2010

I have an Ubuntu Linux on a VMWare running and I've installed RPM Package Manager. However when I try to query all packages using the rpm -qa command, I don't get any results returned.

View 2 Replies View Related

General :: How To Know If The Command Find Any Result

Oct 21, 2010

#!/bin/shLOOK_FOR="NTLMAuthenticationFilter"for i in `find ./ -name "*jar"`doecho "Looking in $i ..."grepjar -e $LOOK_FOR $idoneI wrote the script above, and try to find if there any file name LOOK_FOR exist in those jar,my quest is: grepjar -e $LOOK_FOR $ihere how can I check if there are any successful result , and output them ?

View 2 Replies View Related

Ubuntu Multimedia :: Copy Random Jpg From Random Folder

Jan 19, 2010

I'm looking for a script that copies a random .jpg from a random folder in my ~/Pictures folder to my ~/temp folder with a standard filename. This file will then be displayed in Conky. I can fix the last part, but I cannot find a way to do the first part.

View 3 Replies View Related







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