Ubuntu :: Bash Script That Parses A File For Options?

Feb 26, 2010

how to make an interactive bash script that reads option from a file?

Something like this:

1 : $HOME/scripts/script1.sh
2 : $HOME/scripts/script2.sh
...

The script should look something like this:

Choose an option:

1 : $HOME/scripts/script1.sh
2 : $HOME/scripts/script2.sh
...

And the more options I add to the file the script should be able to detect them and when I choose 1 for example the first script should be executed and so on for the rest.

View 3 Replies


ADVERTISEMENT

Programming :: Create A Script That Parses CSV File?

Aug 6, 2010

I am using RHEL 5.0 and I have some trouble with a CSV file.
What I need to do is to grab all the elements from the 3rd column and place them each on a new line in a different (new) file.

For example, if the CSV file is code...

I tried to threat each line as a string and grab the 3rd element, but for some reason it fail.

View 5 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

Ubuntu Installation :: Installer Options - Can't Select Any Of The Menu Options Except For Boot From First Hard Drive

Mar 19, 2010

So I have the burned ubuntu CD, and I'm attempting to install it on a system that has one HDD with XP/Vista on it, and another that is completely formatted and unpartitioned. However, when I boot to the ubuntu CD, I can use the menus from the bottom, and select the language when initially prompted, but I can't select any of the menu options except for boot from first hard drive.

View 1 Replies View Related

Ubuntu Servers :: Options For A Larger File System?

Apr 27, 2011

I have considered a range of choices, but at the end of the day the choice I make can quite easily put into a situation that requires even more thinking.

The idea is to have an enormous file system for SAMBA that can scale from terabytes to petabytes. Such as a single directory with say 4 million MP3s in my iTunes collection. iTunes cannot use multiple drives easily.

There are lots of vendors that have offerings galore, I wanted to see what can be done with a roll your own approach.

View 5 Replies View Related

Ubuntu :: Help With Bin File - Error Message - Bash - /hldsupdatetool.bin - No Such File Or Directory

Jun 9, 2009

I am new to Linux and I wanted to setup a dedicated game server on my notebook.

I've installed Ubuntu 9.04. I than created a directory named /home/phlex/kfserver. I downloaded the application binary from Steam. I changed the file permission with chmod +x hldsupdatetool.bin and now the file attributes are -rwxr-xr-x.

The problem is when I try to run the binary file. If I type ./hldsupdatetool.bin I get an error message "-bash: ./hldsupdatetool.bin: No such file or directory. It seems the OS can't find the file. I've downloaded the file several times thinking it may have been corrupt but it's not. I can delete the file, I can rename it and so the file is there. Sometimes Linux can be aggravating to use.

View 7 Replies View Related

Slackware :: Options For Enlarging Root File System?

Feb 16, 2010

I need to enlarge the root file system on a Slackware 13.0 32-bit system; it's in a simple logical partition (/dev/sda6) -- no LVM, mirroring etc. This might be a good opportunity to change from ext4 to jfs, too.Routine procedure, no? No!First off I booted Knoppix 5.31 but found it doesn't have ext4 support (no efs2ck and running fsck results in "fsck.ext4: not found").So I booted Slackware 13.0 32-bit CD-1 only to get the same as with Knoppix.I do have a GParted-liveCD 0.3.4-11 but have had mixed experiences with it so am reluctant, despite having backups.

View 11 Replies View Related

Fedora :: 12 - Sudoers File - Change The Option In The Clock Options

Nov 20, 2009

My clock needs to be set to usa time with am and pm But I don't see any option to select that? So I read online that I need to edit /etc/adjtime and change it from UTC to LOCAL

Problem is when I'm in the terminal it tells me I'm not in the sudoers file? So how do I fix my clock? its insane that I cant change the option in the clock options, and its also nuts that even though I created a root password I can't seem to just sudo and change it?

View 5 Replies View Related

OpenSUSE Multimedia :: Different Asoundrc File Options From The ALSA Wiki?

Oct 7, 2010

I've been reluctant to post regarding this topic as I have tried and retried all of the "noob solutions" to get flash sound working but no luck- I need help! I suspect that it has to do with my system showing two sound cards (0 and 1) ; I tried different asoundrc file options from the ALSA Wiki but no luck. I am still left with Flash=No Audio.

View 9 Replies View Related

Programming :: Bash File Comparing - Report How Many Matching Words My Main File ?

Jun 9, 2009

I have been messing with diff and grep for 2 days now without result

I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.

What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn

setup:

Each of em are plain text files with 1 word per line

Output should be something like:

SCRIPT REPORT:

View 8 Replies View Related

General :: Printing From Bash Shell / Concatenate Files Into One File With File Names Included?

May 11, 2011

I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.

Should I be looking to concatenate the files into one file with the file names included, and then print them?

something like: -printfunction -printername < file*

View 7 Replies View Related

Fedora Installation :: Make Menuconfig Options For LIRC Not In .config File Anywhere

Aug 25, 2009

When configuring a custom kernel using fedoraproject.org instructions, the make menuconfig options for LIRC are not in the .config file anywhere. I checked the kernel tree and all the files are there in the .../drivers/input/lirc subdirectory (I need the lirc_dev and lirc_i2c drivers). I reset the .config to its original settings to make sure I didn't mess up. I also grep'ed the .config file for any LIRC related settings, none found. Also I'm not getting any sound from the radio-aztech driver.

View 1 Replies View Related

General :: Filesystems - Where To Find A Description Of File System Mount Options

Aug 28, 2010

Is there some file in Linux that enumerates and describes mount options for file systems like /etc/services describes ports?

View 2 Replies View Related

Software :: Can't Click On Anything In The Window's Toolbar (ie File, Edit, Options, Help, Etc)The Rest Seems To Work Just Fine?

Nov 16, 2010

OS: Ubuntu 10.04 LTSEmulator: Wine 1.2Program: Propellerhead's Reason 5.0After some toil, I successfully installed Reason on linux. Hurrah.However, the default audio drive failed, and now it doesn't have an audio card selected. .. but this isn't my problem.I would love to go into Options to try and tinker with the settings, but I can't click on it. In fact, I can't click on anything in the window's toolbar (ie File, Edit, Options, Help, etc)The rest seems to work just fine.

View 2 Replies View Related

Programming :: Bash File Which Requests File Name

Nov 30, 2010

What's the easiest way for me to make a program that requests a file location and then tar balls it. I basically want to start making a simple method of using pv with tar (lzma).

View 8 Replies View Related

Ubuntu :: /bin/bash: : No Such File Or Directory

Jan 20, 2011

I had netbeans installed and I removed it using wheris netbeans and then sudo rm whatever files it gave.I also remember doing sudo rm -r /usr/lib/netbeans6.9 I did this because i wanted to install netbeans via the repo. Now I installed netbeans suing

Code:

varun@varun:~$ sudo apt-get install netbeans

and when I try running netbeans i get...

Code:

varun@varun:~$ netbeans
/bin/bash: : No such file or directory

Have i changed permissions or something?

View 1 Replies View Related

Ubuntu Servers :: Webdav + Nautilus = Forbidden - DON'T Have "Options Indexes" In Apache Config File When Try To Access Via Firefox

Feb 20, 2010

I've installed webdav on my server and I can access it fine through cadaver. However, when I try to access it via nautilus, I get Forbidden. It is NOT secured (SSL). When I try to access it via firefox, I get an error since I DO NOT have "Options Indexes" in my apache config file. If I add this option in, then I can browse the root direction and webdav folder via firefox, but still not from nautilus. what other information you need. I've googled and searched the forums for awhile, but not "solutions" I found have worked for me. I want the webdav folder to just be a single folder within the direction, so this is how I have my config file setup:

[Code]....

As a side-note...when I included "Option Indexes", it allowed me to view the passwd.dav file from firefox!That doesn't seem very good...

View 4 Replies View Related

Ubuntu :: [bash] Edit The End Of The First Line In A File?

Jan 18, 2010

if I can create a bash script that once executer will edit or replace a line a in a file this line is the first one and its just one character that needs to be changed from a 1 to a 0.

How do I go about this? it is for a game called EVE Online, heres what my .sh look like atm

#!/bin/sh
echo fixing prefs.ini
#fix for prefs goes here
echo starting eve
eve

View 4 Replies View Related

Ubuntu :: Convert Bash Into Executable File?

Jan 19, 2010

SO I'm not talking about changing the file permissions, The only thing I could find on google was this [URL]Basically can you convert your bash script into a executable file, One that you can't open in text editor?

View 2 Replies View Related

Ubuntu :: Getting Out The Resolution Of A Video File In The GNU Bash?

Dec 14, 2010

Hopefully this post is here at the right place. I need some information about the GNU shell. I want to write some bash script which is able to sort movie files by resolution of that video. I noticed under GNOME, it's able to view the resolution of a video file by rightclicking clicking on the file and choosing properties afterwards. I would be glad if anyone could tell me which shell-command GNOME uses for this action.

View 2 Replies View Related

Ubuntu :: Bash File Color Decoding?

Apr 15, 2011

Is there a place in my 10.04 OS that tells me the meaning of the colors of files? I have a folder that I moved to my home directory when i upgraded from 9.10 to 10.04. In that folder was a .tar.gz file that was green - I then deleted that file and ran another compression command - same files, same everything, but when I ran it this time, it is now red. Any ideas. I'd like to know what the color indication is on any given file.

View 2 Replies View Related

Ubuntu :: Bash - Putting String In File?

May 28, 2011

OK I have a simple script that does:

Code:
# Create temporary file:
pwFile="~/Tmp/temp.cnf"
echo "$password" > "$pwFile"

But I get an error message:

Code:
~/Tmp/temp.cnf: No such file or directory

View 3 Replies View Related

Ubuntu :: Bash Script To Name File After Folder?

Jun 7, 2011

Question for people good with Bash scripts.

In a script, how do you name a file after a folder?

For example code...

View 9 Replies View Related

Ubuntu :: Bash Error When Launching A File?

Jun 8, 2011

This is my problem

bash: /usr/local/uvlayout-pro/bin/headus: No such file or directory

but the file exists. If I uncheck the Allow execute as a program the error is

bash: /usr/local/uvlayout-pro/bin/headus: permission denied

I used the sudo command.

(I tried to change the folder permissions to read and write, cause if I didn't, then the file, when not in nautilus, had an x in the top right of the icon. Before this it didn't work anyway)

View 6 Replies View Related

Ubuntu :: BASH Script To Get PID Of Java File?

Jun 18, 2011

I have a simple bash script called run.sh:

Code:
java -jar /testing/run.java How do I get the Process ID and save it in a file called "PID"

View 1 Replies View Related

Ubuntu :: Assign Values To Bash Variables From A File?

Jun 9, 2010

Is there an easy way to get a line from a text file into a variable in a bash script?

I have a file called outside_temp that has a single number, say, 63.2

I would like to make a variable in a BASH script have that value.

I know how to use the input redirection and reassignment of stdin using code...

View 1 Replies View Related

Ubuntu :: Bash Scripting: Making A Text File

Jul 12, 2010

I am tying to write a script that asks for user input and saves it to a text file using awk so example #!/bin/bash read a awk #saves to file

I had a working scripted last night, deleted it by mistake and for the life of me can not remember how i did it.

View 2 Replies View Related

Ubuntu :: Bash - Check If All The File Names Are Correct?

Sep 23, 2010

I have bash script for converting files. I have a problem. If file name is "corrupted" then mv command for that file will not work. For example file with "-" in front of the name.

Is there a way to check if in some folder (subfolder) all the files have correct file names or they don't?

If they are all correct -> OK proceed with execution of the script!

If they are not all correct -> NOT OK stop with execution of the script!

View 4 Replies View Related

Ubuntu :: Read A Variable From File (bash Script)?

Nov 8, 2010

I googled and tried to find an easy step by step-by-step guide on how to use a bash script read a variable from a file. This is the way I did it (but it does not really work so something is wrong, but what?) (testfil2 contains one line that readsidnumber=1578

#!/bin/bash
value="/home/user1/Desktop/testfil2"
echo $value
kill $pidnumber

View 4 Replies View Related

Ubuntu :: Copying File To A Remote Ftp Server With Bash

Jan 10, 2011

I'm hoping to set up a cron job that takes a file and copies it to a remote password protected FTP server. I've got a command that formats the file with the correct name and I've put it in the anacron file in /etc/cron.d (which I think is right, haven't tested it yet).I'm not sure how to copy the file to a remote server though. I do actually have the ftp server bookmarked in my places menu. So is there a simple way of suppling a file path that will put it straight into that folder? The only problem I can see with this is that the connection won't be open continuously, so would need to be re-opened when needed (I could presumably save the password in the keyring so that I don't need to be there to type it in).

Or maybe set up a cron job that connects to and mounts the ftp server a minute before it has to copy the file over?

View 9 Replies View Related







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