Ubuntu :: PHP Value Of Variable Put Into A Textfile Using Unix?

Feb 1, 2011

How can I put a value of a php variable into a text file. I cant append or write the values into a text file.

View 2 Replies


ADVERTISEMENT

Software :: Find A Word In A Textfile Starting From The BOTTOM Of The Textfile?

Feb 8, 2010

I have a text file example :

word1
word2
word4

[code]...

View 3 Replies View Related

General :: Setting A Variable In Unix?

May 11, 2010

Whenever i want to start tomcat server I need to go totomcatdir>inand execute startup.sh file.How would i make this happen whenever i start my machine?Also want to know How would i set the variable at startup.

View 10 Replies View Related

Ubuntu :: Reading A Value From A Textfile Using Bash Script?

Jun 10, 2011

I have a text file that contains a single word and I want to write a bash script that will read the word from the text file... The following is my incorrect attempt, as it assigns the name of the textfile to the variable as opposed to the word stored within the textfile:(assume I have a text file value.txt that has as its contents a single word, say wordone)

#!/bin/sh
for f in value.txt
do
echo $f
done

so the output of the above script is value.txt, however I want it to be wordone.to summarise: how do I assign the value of the word contained within a textfile to a variable?

View 2 Replies View Related

Programming :: Need To Save Textfile'$+1'.txt?

Apr 1, 2010

need a script to achieve saving multiple text files as 0001 0002 0003 etc.or moving files to a folder displayed this way..there prolly is an " if " statement involved also...if 0001 exist then %+1 and so on.

View 1 Replies View Related

General :: Bash - Subtract Contents Of One Textfile From Another

Jul 7, 2010

I have two text files on Linux. One contains a list of valid IDs. E.g:
abcd
efgh
ijkl
etc.

The other contains a list of invalid IDs. But, some of these also appear on the list of valid IDs, in this example "efgh":
mnop
qrst
efgh
etc.

How can I easily construct a text file that contains all the lines from the invalid list that do not appear in the valid list? That is, I want to end up with a text file that has:
mnop
qrst
etc.
I'd like either some Linux commandline magic of some clever Vim trickery.

View 3 Replies View Related

General :: Parse A Textfile To Move Some Files?

Mar 9, 2010

I use avg free as antivirus scanner. I looked some time for a scanner to scan and remove viruses. Problem is avg 8.5 will only detect viruses, not remove them...I use a oneliner looking like this:

Code:
/usr/bin/avgscan / -x /mnt -x /dev --heur --ignerrors -r /var/log/"scanlog"`eval date +%Y%m%d`".txt"

[code]...

View 5 Replies View Related

General :: Save Each Line From Textfile As New File?

Jul 4, 2011

just started with Linux and I'm trying to create new files for each line of my input file. So I have file with 637 lines of data:

2 4 6
2 8 5
3 0 5
etc

and want to create a new file from each line. With

cat name.txt | awk '{ line = $0
print line
}'

I nicely see all lines, but what rests is to save each line separately into new file. I tried While read line command in combination with output >> $.txt, but didn't work well..

View 8 Replies View Related

Programming :: Awk - Calculate The Number Of Words Containing Letter E In A Textfile?

Oct 12, 2010

i need to calculate the number of words containing letter e in a textfile.

View 9 Replies View Related

Fedora Networking :: Can Access Unix Machine From Another Unix Machine?

Feb 23, 2009

i have been using samba to gain access into windows computer through my pc which has fedora 8 ..can i access the unix machine from another unix machine? is yes then what is the procedures ?

View 4 Replies View Related

Programming :: Bash - Read Content Of File To Variable And Use This Variable In For Loop ?

Aug 21, 2009

I'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).

View 6 Replies View Related

General :: Assign Local Variable Values To Global Variable?

Feb 17, 2011

how to assign a local variable value to a global variable....

View 2 Replies View Related

Programming :: Make A New Variable With The String From The Old Variable Btut Without Any Plus Sign?

Apr 7, 2010

my 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#+}

View 4 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

Software :: Get Variable From Text File Into Bash Variable?

Jun 10, 2009

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 Related

Programming :: Search Within A Variable And Assign The Results To A New Variable?

Apr 25, 2011

how I can search within a variable and assign the results to a new variable. I'll use the following as an example -

cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`

with the echo command I get the following output assigned to list -

A
C
C

What I'd like to get for output is -

Audi
Cadillac
Chevy

how I could do this regardless of upper/lower case letters?

View 5 Replies View Related

Programming :: Assign Value Of C Variable To Shell Variable?

Apr 28, 2010

included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?

View 8 Replies View Related

General :: Use The Value Of One Variable To Generate A Name For Another Variable?

Jul 25, 2010

can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example

objectnames1=`ls -a`
objectnames2=`ls -a`
etc.

i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.

if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...

View 6 Replies View Related

General :: Sed Substitution Of Variable With A Variable?

Dec 27, 2010

I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?

#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)

[code]...

View 6 Replies View Related

Programming :: Assignment To A Variable Variable?

Mar 17, 2011

This loop is part of a bash script which takes multiple arguments.

Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))

[code]...

View 3 Replies View Related

General :: Bash - HISTSIZE - Readonly Variable -bash - HISTFILESIZE - Readonly Variable

Dec 8, 2009

On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.

View 5 Replies View Related

General :: Unix Commands Same For Mac And Ubuntu?

Aug 21, 2010

I wonder if the unix commands (cp, mv, grep, args etc) are the same for Mac and Ubuntu. Do they have the same parameter lists and so on or do they try to stay the same but are slightly different?

View 3 Replies View Related

Ubuntu :: Active UNIX Domain Sockets?

Jul 27, 2010

After my first installation/ version of Ubuntu 64, I performed a netstat and noticed I did NOT have any Active UNIX domain sockets as I do now. After doing some research, I found this is related to MYSQL and server services which I am in no need of running and nor do I want to run if not needed. So exactly what are these services used for, which app is creating this and why?

Is it possible to remove the app or processes if they are not needed? Killing these connections every time they attempt to establish would be rhetorical.

~$ uname -a
Linux panda 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux
:~$ netstat | more
Active Internet connections (w/o servers)

[Code].....

View 1 Replies View Related

Ubuntu Networking :: Unable To Ssh To A Unix Box From Laptop?

Oct 2, 2010

I was able to ssh to a unix box from my laptop (I generated public and private keys and copied the public keys to the remote machine). Is it normal that I cannot ssh from the unix machine to my laptop? I expected that I could log in from both machines to the other. I am running ubuntu on my laptop and the other machine has redhat.

View 6 Replies View Related

Ubuntu :: New Hyperaccelerated Alternative To Unix And Windows?

Jan 2, 2011

new hyperaccelerated alternative to unix and windows

View 1 Replies View Related

Ubuntu :: Remotely Accessing Unix Machine Using Ssh?

Mar 10, 2011

I am trying to set up a ssh server on my desktop computer. It runs Ubuntu 10.04 with Win 7 (dual boot). I want to ssh into my desktop from any other machine (from anywhere), and I'm not sure if setting up a ssh server is the right thing to do. Also, is it secure? what kind of encryption does it use

View 5 Replies View Related

Ubuntu :: Run A Remote Unix Session Using System?

Aug 2, 2011

At the moment I am using Hummingbird Exceed on a windows PC to display X windows from a Unix server. The actual Exceed tool I use is called 'hwm' which I believe is basically an pc based X Windows manager. I do not need to configure anything other than the client computer name, IP address and screen definition and the server will then allow a connection and display the X windows on the client. I was wondering if there is an equivalent application I can run using Ubunto as a client insted of a Windows PC?

View 1 Replies View Related

Ubuntu Security :: Understanding Unix Style Permissions

Jul 20, 2010

On Windows, you can go to a file's permissions and it's clearly stated who can do what. You can choose between individual users or groups such as 'everyone' or certain types of users such as 'domain users'. You could create a clear cut list of every single user/group on the system and what their permissions for a file are and have it neatly displayed in a list.On Unix, we have octal permissions and sticky bits. I understand the whole concept of rwxrwxrwx (777). The first three are what the file owner can do, the second is what the main group the user belongs to can do, and the third is what other users can do.

But, when you view a file's permissions you are only getting the permissions as they apply to the user that owns the file. For example, as I understand it, if I viewed a file that only the root user had rwx permissions on and everyone else could only read. The permissions would show up as rwxr--r-- (744). But, those same permissions would show up to any user as 744 as well. Since the last 3 characters are what applies to "other users" (pretty vague). How would someone know what users in particular those permissions apply to? There could be one "other user" that can rwx that file and another "other user" that can't.Also, why just stop with the main group? What about other groups? A the user Foo's main group he belongs to might be Foo. But he could also belong to the groups Boo and Zoo, which belong to other users and would give him full rwx permissions over Boo and Zoo's files just as if he were Boo or Zoo.

Then you have the whole sticky bit thing that makes it so that files can be owned by the same person and at the same time be made use of (to varying degrees) by other users. To chmod the UID you'd chmod 2777 or for GID 4777 (just an an example). I did this for a file and it allowed a standard user account who was previously unable to run the command to be able to run it. But, how can that work when I didn't anywhere specify what particular user (or groups of users) that sticky bit applies to?

I'm confused about this whole thing to the point that I'm not even sure exactly what questions I should be asking or even if my examples are even 100% correct. I just sort of ranted about some specific things that floated to the top of my head. Permissions are easy to understand when your running a Unix-like system on a single user desktop. Because the only users/groups you have are root, the single user, and various system users/groups that you don't really need to worry about. So a file with rwxr--r-- means that only the Root user (not even members of his group) can edit the file and you can't unless you use sudo. Because the "other user" in the last 3 characters always just means you. But, things seem to get a whole lot more complicated when you start adding in multiple users. Can someone explain this or link to a "for dummies" article that can explain all of this to me in a way that someone who's used to Windows style permissions can make a connection between the two OS families and their way of handling these things?

View 9 Replies View Related

Ubuntu :: Mount HTFS (SCO Unix File System)?

Jul 30, 2010

Howto mount HTFS (SCO Unix file system) under Ubuntu?

View 3 Replies View Related

Ubuntu Networking :: Cannot Find Unix Dial Up Modem

Feb 25, 2011

I tried Gnome-ppp but terminal can not find it! Retired can only afford cheap dialup.

Where can I get a version of ubuntu that has system -> administration-> networking?

View 1 Replies View Related







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