Ubuntu :: Definition : What Is A Variable File?
Nov 15, 2010what is a variable file?
View 2 Replieswhat is a variable file?
View 2 RepliesI'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?
View 2 Replies View RelatedMy script.
This is may script:
Code:
Problem: Output file doest not exclude the values in grep -av
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
I have an executanle file in a directory (say /home/mahmood/test/do-sample) and in a bash file I want to run it:
Code:
#!/bin/bash
M_VARIABLE = $HOME/test
[code]...
I am trying to sort a file, so I can compare it to another file later. I am storing the file name in a variable called curMo. I then call sort $curMo and it hangs for a very long time and I have to quit the process. why this is not working or how to make it work?
Here is part of my code:
#sort this file for this Location
sort -u $curMo -o $curMo.sorted
I'm running Ubuntu 8.04.4 LTS to host a moodle server in a school.. moodle is running OK - but I'm having problems with MySql Any mysql command generates:
unknown variable 'pid-file=/var/run/mysqld/mysqld.pid'
I've taken a look in unknown variable 'pid-file=/var/run/mysqld/ and there is no mysqld.pid file I have followed these instructions that I found elsewhere:
If there�s no mysqld.pid inside /var/run/mysqld directory, create mysqld.pid
# cd /var/run/mysqld
# touch mysqld.pid
[code]....
But after reboot the mysqld.pid file is missing again.. I can access mysql via phpmyadmin - but webmin fails with unknown variable 'pid-file=/var/run/mysqld/mysqld.pid'
I installed Chrome straight from the Google webpage. But, it kept crashing. So I've uninstalled it to go back to Firefox, which I never uninstalled. Problem is, now, links in Evolution and Gwibber no longer work! It's still trying to open Chrome. Presumably I have to edit a variable or config file with the path to the browser in it? Where would I find this?
View 2 Replies View RelatedDue to a change in how programs in Linux are allowed to use memory, before using SheepShaver you need to set a variable in the file /etc/sysctl.conf Add this line: vm.mmap_min_addr = 0 but when i add the line in my text editor it says i cant save
View 8 Replies View RelatedI edit /etc/environment file and write there my variable by it's not effected, what i need to restart daemon that it's show on echo $VARIABLE.
View 1 Replies View RelatedHow can we do a file replacing string on debian/rules file using sed and bash variable ? I don't seem to be able to do so. I have tried below under the install section with arch dependent amd64, as far as I know all the bash commands are allowed to be executed in debian/rules file.
I have tried this :
Code: Select all
debian/rules file
ipaddr=`<long command to find ipaddr>`
myVar=`hostname`
sed -i -e 's/somestring/'$myVar'/g' $(configs)*
sed -i -e "s/somestring/$myVar/g" $(configs)*
[Code]...
Nothing works. Sed works but the hostname replacement doesn't work.
I want to replace a certain line of a file, my bash script looks like:
#!/bin/sh
sentence="if [ -e /home/inf/Download/$playlist ]"
sed '4c
$sentence' oldfile > newfile
mv -f newfile oldfile
But the variable $sentence can not be identified in ' ' . And also you can see I just want to update the old file. But the sed command can not save the file for me ,so I need to write them to a new file and over write the new file .
Originally Posted by Gekitsuu you should be able to do NEWSTRING=$STRING1$STRING2 it works but i can't use it for creating a path variable / file name.
e.g.
$STRING1 = path
$STRING2 = filename
cat $STRING1$STRING2 will not work.
so how to get this working?
I know that cat can output the file, but how do you store that output in a variable to process:
Code:
CONTENT=cat file.txt
This doesn't seem to work?
I made 2 files which are different from the program above one is temp1.h and another is temp2.c to understand how extern is used. So here is temp1.h
Code:
#include<stdlib.h>
typedef struct node * bond;
extern int jk;
and temp2.c is
Code:
#include<stdio.h>
#include<temp1.h>
struct node {
int data;
[code]...
I had declared jk in temp1.h as an extern int so why can I not initialize it in temp2.c?
I am having hard time playing a high definition video file (.mp4), the video initially plays fine, but after 5 mins, it starts to skip and stutter, (I use Movie Player with some codes that Ubuntu installed when I first tried to play file) I have a Dell XPS M1330 Intel Core Duo @2.20 GHz with 4 GB RAM.
View 4 Replies View RelatedI have an Olympus VN 4100PC voice recorder. It does not work with linux. I found odvr, but the instructions on how to use it are rather general. I haven't found an rpm or a yum definition for odvr, so I'm compiling it from source. how to use it though.
View 8 Replies View RelatedI see the term used all over the place of course, just wondering *exactly* what it's used to describe....? Is it just the next hop on your ISP's internet connection?
View 1 Replies View RelatedI would like to automate a definition process. I have 11,581 to define. :|
I would like to read each word, copy the definition(s) and append it next or below the word or save definitions to file.
The word list has one word per line.
Python script?
Bash?
Perl?
Its an interesting project but I cant seem to figure it out. Lack of programming skills.
I have the following header file in /usr/include/test.h:
Code:
#ifndef TEST_H
#define TEST_H
const int test_version = 1;
#endif
[Code].....
I did some searches and after a few hours was able to get what I needed. What I didn't find was a fully encompased means of what I'm used to in the windows world in working with delimted files. Hopefully this is helpful to others and if there is something better or leaner way, even better.We have an issue where managing printers, just viewing on RHEL w/ sys-conf-prtr we lose any number of, up to ~30 printers from lpadmin. Rather than stare and compare to find the missing ones, I wanted to make an intuitive script. This is what I came up with.
Code:
#!/bin/sh
while IFS="," read Prntr IP; do
[code]...
I am connecting to MySQL DataBase using shellscript and writing a select statement like select attachmentid from attachments where pageid=10175 I want to store the output of the select statement into a shellvariable or a file. How can i do it using shellscript.
View 4 Replies View RelatedI have a file (.tmpfile) and inside it is a string which i only know part of, the rest being a random group of characters... I would like to know how to pull the whole string out of the file and into a variable.
View 13 Replies View RelatedThere is the Archive::Zip I think I can use with Perl 5.10 but I don't know how. I don't want to read or write any files, just zip something in memory, with best compression, like
$text = "this is a test";
$zippedtext = &Zip($text);
sub Zip {
[code]...
I guess it's only a few lines.
I created the following.
x="top
middle
bottom"
I would like to make the following work.
while read line
do
echo $line
done
instead of importing a file I would like to use the variable $x I tried using pipes, but with no luck. My goal is to read one line at a time, but not have to export my data to another file, I would like to keep it all within one script.
How can i make a variable in a bash script, to refer each file in a folder,and to switch it to the next file,until the last file of the folder?
View 2 Replies View Relatedhow to assign a local variable value to a global variable....
View 2 Replies View Relatedmy script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
I am like almost everyone, watching videos on ..... and I am having problems with flash. When I put a video on - even if high definition or not I still get a studder from flash. The video plays but it keeps chopping up and you can see on some frames how the next frame moves on the bottom of the screen and the previous frame is still stuck on the top. Flash does not run smoothly at all - that is on every video. I am suppose to be on the latest flash version for linux off of addobe.
View 4 Replies View Related