General :: Shell Script That Reads From Parameters File?
Nov 3, 2009
what I am trying to do but I am not sure exactly how to do it. I want to write a shell script that will replace certain values in a file with environment specific information that it pulls from a parameters file. The paramaters file looks like the following...
[dev]
ip=10.15.109.41
name=dev1.mydomain.com
[code]...
View 4 Replies
ADVERTISEMENT
Apr 18, 2011
I am trying to write a script (especially C-shell) to execute a fortran code that reads in parameters from keyboard typing. I will have to process this .F code for many times with the parameters the same for all my data files, therefore, I don't have to type in everytime I execute the .F code. But I don't know what is the command in c shell to read in a text files that contains all the parameters I want and can make the shell read in appropriately to feed the .F code.
View 3 Replies
View Related
Feb 2, 2011
I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (~/project/src):
python manage.py shell
This opens up an interactive shell for me to start typing my own commands.I have another set of administrative activities that I would like to house in another directory (~/project/admin). The manage.py is really finicky about running from the working directory. So, to make this whole thing work, I made a script which starts off like so:
#!/usr/bin/python ../src/manage.py shell
There are a couple problems with this. The first is that it doesn't work:
/usr/bin/python: can't open file '"/../src/manage.py" shell': [Errno 2] No such file or directory
How do you specify multiple parameters to the interpreter?How do I change the working directory?
View 2 Replies
View Related
Jul 13, 2011
I was analyzing the Disk read using hdparm utility. This is what i got as a result.
Code:
# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 108 MB in 3.04 seconds = 35.51 MB/sec
Code:
# hdparm -T /dev/sda
/dev/sda:
Timing cached reads: 3496 MB in 1.99 seconds = 1756.56 MB/sec I m not sure what does Cache read and buffered disk read mean.
View 1 Replies
View Related
Jun 16, 2011
Why does this work
Code:
for myfile in `find . -name "R*VER" -mtime +1`
do
[code]...
View 2 Replies
View Related
Mar 12, 2010
myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory
Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?
View 1 Replies
View Related
Dec 7, 2010
I am new to bash scripting (not programming in general).
I am writing a bash script that will run a Python script I have written.
I want to be able to do the following:
Pass parameters to the bash script via the cronjob (so I can have two cron jobs) one to be run with parameter 'foobar', and the other 'foo'
switch based on the parameter passed to the bash script (by switching, I mean an if/else based on the paramter passed to the bash script).
View 3 Replies
View Related
Feb 23, 2011
Is there already a program that reads multiple pipes or file descriptors and writes to the standard output (not splitting lines).Like cat, but reading all files simultaneously and preserving lines.It is needed to avoid coding of select/epoll loops or using multithreading in simple programs. Like "select loop for bash".
View 1 Replies
View Related
Apr 12, 2010
I am setting up my test / development machine with the following scenario in mind : I boot the machine and then select one of a number ( e.g. 3 ) boot options in Grub ( Normally "OpenSuse", "Safe Mode" etc., but in this case "System Restore Dev.", "System Restore Test" ). The only difference between these options are the settings ( e.g. "vga=378" ) in these cases something like "distro=dev" / "distro=test".
In a script run on the booted system I can extract the value of the "distro" parameter ( in this case "test" ) and use it as input for a command line tool. Meaning that name entered as the value for the "distro" parameter is used for loading a file when the system is up and running. The command line tool then restores the partition with the contents of the file and reboots the system.Now, my problem is this : How to I access the Grub arguments? Code snippets ( in shell scripting or python preferbly ) are more than welcome.
View 10 Replies
View Related
Jan 4, 2011
Some may recall I recently gave up on bash, rather than give up my programming style.Surely I will have reason to return but that's another story. My little issue now:I am debugging a new [Korn] shell script. I have a function that performs a specialized match on a string and I see that I am able to call that function with no problem, with both of it parameters. The function does not do any print or echo command - it uses "return" for a TRUE (0) of FALSE (1), as is the shell exit code convention. Thus, I have the following test:
Code:
if [[ match_except_release ${PATH_DIR[$LC]} bin ]]
then
[code]....
View 2 Replies
View Related
Dec 26, 2010
Due to crash of 10.04 grub, I installed it again from a live CD on D drive "C drive has windows 7", then immediately after install, I upgraded to 10.10 64 bit. Need to change the boot to Windows loader and not directly to Ubuntu as it happens now. I see "windows loader as an alternative option" and it works when I select it. when I boot to windows, my computer icon reads only one file on D drive "bootsqm.dat". from Ubuntu computer option, I can access all windows files.
View 3 Replies
View Related
Jan 23, 2010
i just installed ubuntu and i wanna put wine on so i can install my itunes and adapters an so on. but when i try to install through terminal it always reads that theres no file found or cant complete installation. and theres no net hooked up to it cuz the wireless adapter wont work.
View 3 Replies
View Related
Mar 11, 2010
Here the description of the issue I am having.I am writing a bash test script which reads lines from a file, builds ISO messages, sends them to a server, reads the response with response code and reports the result of the test to a file or on the screen.The message that I need to send is 94 characters long.Here's the portion of a code that I initially wrote:
#~ Open socket.
exec 3<>/dev/tcp/172.26.0.25/9991
#~ Send msg.
[code]...
View 4 Replies
View Related
May 15, 2011
When reinstalling ubuntu 10.04, I get an error message that reads "the ext4 file system creation in partition #1 of SCSI3 (0,0,0) (sda) failled.
View 1 Replies
View Related
Dec 9, 2008
How can I read .gz file direct on shell/terminal without decompressing the file?
satimis
View 5 Replies
View Related
Mar 30, 2010
I need a shell script that will add the users name and date to a file when the user has modified the file, these files are within a group and only accessible to this group. But we need a way for people in the group to know who and when the file was last modified.
View 1 Replies
View Related
May 23, 2011
i am trying to convert a binary file in to ASCII using shell script. this file contains multiple types of data like string, number, bcd, etc.
View 5 Replies
View Related
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
Oct 24, 2010
I have a Java program (minecraft server) that needs to be run from the command line. The code is:
Code:
java -Xmx512M -Xms512M -jar minecraft_server.jar nogui
To make life easy (i've got the java file in a folder on the desktop) I want to have a shortcut (or similar) sitting on the desktop. I've tried
Code:
ln 'java -Xmx512M -Xms512M -jar minecraft_server.jar nogui' ./../minesraftserver
with single and double quotes but my unix command line skills are pretty basic and this is obviously incorrect.
View 2 Replies
View Related
Mar 26, 2010
I was wondering if there is a way to change the value of positional parameters inside a file.I mean, i want to change the value of a certain field of a file to the one i provide with?
View 6 Replies
View Related
Jul 2, 2010
We are graphing various system parameters using Cacti. One of our graphs shows hard drive reads and writes. A question came up: why do we need this graph?
View 3 Replies
View Related
Apr 27, 2011
I got a CD with a book - doc files.When I look at it with nautilus or with wine notepad it tells me that the CD is empty. capacity 49.4 MB. It does show the name of the CD BOOK2XTRAS - so at least the name field in the first sector is where it is supposed to be.When I boot to my 2nd drive - an old win98 sys - it sees all the files on the CD. Same CD drive in each case. I go to another fedora computer I have and it does n.ot see the contents either.
View 5 Replies
View Related
Nov 9, 2010
I have a text file that needs to be updated to be used by some fortran code later. it looks like that:
1,1 !Ms for y-stations, Ns for x-stations
0,0,0, !xsta, ysta, zsta
I need to replace the "0,0,0" with new values for xsta,ysta and zsta;
View 4 Replies
View Related
Jan 22, 2010
I am trying to create a function within my .bashrc that will process all of the files that do not end with .sh within a directory and execute them.The following is what I have so far. I am missing a way of excluding files that end with .sh though.
function startall {
for file in /etc/init.d/*.; do
"${file}" start
[code]...
View 2 Replies
View Related
Oct 23, 2010
I would like to create an unattended install ubuntu 10.10 cd. I have followed the ubuntu [URL].. on creating the preseed file, however, I can't find any useful tutorial on how to set the kernel parameters to perform an unattended install using my preseed file.
View 1 Replies
View Related
Jan 3, 2011
So if I have a file with a list of files:
file.txt
file1.a
file2.b
file3.c
and I wanted to perform a script using a loop or recursively on each of those files, is there any way that I could do this?
I saw that xargs might be able to help me.
Here is sorta what I want to do:
Code:
#!/bin/bash
cat file.txt | xargs?? # Some commands to turn each line into a variable
for var in ${@}; do # Some way to get each of the files
# script on each file
View 1 Replies
View Related
Jul 30, 2010
I'm using Ubuntu minimal install (With no window manager). What is the quickest and easiest way to upload a file somewhere? Something like a script to pastebin would work.
View 2 Replies
View Related
May 9, 2011
I have a small script that uses the find command to look for a log file named: backup_log.txt. And then uses the first value in the log file as a variable in the script later on. However, say there are two or more of these log files located in different directories, how would I let the user choose which log file will be the one to use, and then make that (fullpathtofile) the value of the variable that will be used.
View 5 Replies
View Related
May 2, 2011
I am working on some homework, however i am not here to be spoon fed. I am trying to get the numerical modification date of each file in a folder. Ie lets say there is a file called bob and it was modified 2006-11-23. i want to get it into a variable as 20061123.
Now i currently have this code:
Code:
However for some reason my output is:
Quote:
See how the 2011 has been placed next to it? i ran it with -x and saw this:
Code:
However i do not know how to find a way around this?
View 11 Replies
View Related
Jun 21, 2010
I need to convert the following .bat file to a linux shell script.experienced and kind linux folks:
:: Import database schema
echo off
echo.
[code]....
View 2 Replies
View Related