General :: Search A File To Find If Variable Belongs To A Field?

May 18, 2011

I have a file that contains 5 fields and anothen one with two I want to take the value from user and search file1 and if the value exists then write in file2 to the $2 to the line that $1=value

file 1
1:fsdfsd:g:33:fsdf
2:yytgdcf:a:3:sgd
3:tttt:g:67:yujhggfg

[code].....

View 2 Replies


ADVERTISEMENT

General :: Sed/awk/grep Search For Number String Of Variable Length In Text File?

Jan 19, 2010

I need to search a text file for a string of numbers which are different lengths, and always are between number=" and " like:

number="1234567890"
number="22390"

I need to grab those numbers and pipe each one to a line in a file. I've already tried something with awk and that didn't seem to work.

View 10 Replies View Related

General :: Find Command \ Search File Excluding The NFS?

Jan 20, 2010

I want to search file excluding the NFS ...find / -mount -name 'filename' restricts the search only in the root disc partition,but the file can be in other partitions alsoIs there any way to exclude the NFS only.

View 2 Replies View Related

General :: Find Text After String Search In File

Aug 2, 2011

I have a file called Regions.ini that looks like this:

Code:
[Granite]
RegionUUID = 54ab7cd2-0e70-49b7-8020-8dbeb84c08d0
Location = 9991,10007
InternalAddress = 0.0.0.0
InternalPort = 9001
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9

[Syenite]
RegionUUID = 8fc56fdd-0afd-4074-9432-0ae8f42b799f
Location = 9992,10007
InternalAddress = 0.0.0.0
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9
What I need to do is find out what the IP address is after "ExternalHostName ="

After that I will need to compare that IP to whatismyip and if it's different then replace it but that is easy to do with sed. I just can't figure this simple hurdle out.

View 12 Replies View Related

General :: Find Command When Loggin As A Normal User And Search For A File Passwd Under?

Dec 25, 2010

when loggin as a normal user and search for a file passwd under /etc. i get few errors with permission denied.how to ignore this permission denied errors.

csh hostname 109 % find . -name passwd
find: ./lvm/backup: Permission denied
find: ./lvm/archive: Permission denied

[code]....

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

Networking :: How To Find Out Which Eth0 Or Eth1 Does Card Belongs

Jun 15, 2011

I have in my ubuntu 3 eth?
eth0
eth1
eth2

just eth1 has an IP address...

I just have remote access to the server via ssh.

How do I find out which eth0 is a fiber nic ? Because I know one of them are.. but I cannot assign any IP address to them..

which eth? belongs to this fiber nic ?

View 5 Replies View Related

Ubuntu Networking :: Wireless Connection Search Domains Field?

Sep 3, 2010

I have installed ubuntu netbook addition and all is good, but when I try to connect to internet I get comcast(my service provider) site. Which means I am connecting to outside world just need to know what to enter in Search Domains field.

All my pc's/laptops at home have 2 DNS names entered for ipvr4 listed in the field but no Search Domains field value specified and it works great off of wireless router.

Well here when I go to IPvr4 tab it seems like I am required to enter value in search domains field. The question is what do I enter there COMCAST domain? Like this one: hsd1.il.comcast.net?

View 5 Replies View Related

General :: Field-terminating Char Appears Within Field Values?

May 18, 2010

I've had a very colorful morning learning the innerparts of Linux's sort command, and have come across yet another issue that I can't seem to find an answer for in the documentation. I'm currently using -t, to indicate that my fields are split by the comma character, but I'm finding that in some of my files, the comma is used (between double-quotes) within values:

Jonathan Sampson,,foo@bar.com,0987654321
"Foobar CEO,","CEO,",ceo@foobar.com,,

How can I use a comma to terminate my fields, but ignore the occurences of it within values? Is this fairly simple, or do I need to re-export all of my data using a more-foreign field-terminator? (Unfortunately, I do not have any control over declaring a different terminator with this particular project).

View 2 Replies View Related

Ubuntu :: Deskbar - Search Field Present At All Times In My Lower Panel

Jul 15, 2010

I installed deskbar and really like it as a multi search tool. But I would really like to have the actual search field present at all times in my lower panel. Right now, I just have the deskbar icon, which is like a magnifying glass with an orange little "electrical shock" (kind of reminds me of like a cardiogram line) coming out of it. I have seen screen shots before of other people's desktop with the actual search field constantly in the lower panel. And it was mentioned in those screen shots that it was in fact deskbar.

View 2 Replies View Related

Debian :: Why Apt-file Search Wx-config Not Find - Lenny

Dec 31, 2008

How apt-file works.

Background: I (like somebody else) needed to figure out which package wx-config is in.

Code:

Question: Which package makes a link?

Also why wx-common NOT depends on libwxgtk2.6-dev.

View 4 Replies View Related

Programming :: Find Command To Search For All The File In The Particular Folder?

Aug 2, 2011

how to use find command to search for all the file in the particular folder?my script as below

find . -name "*" > $BASE/file
if [ `more file | wc -l` -gt 0 ]; then
echo "dp"
fi

output of my results will always include a . (dot)which I dunwan it include the dot.

View 11 Replies View Related

Ubuntu Security :: IPBlock: Exhausted Search To Find Download File?

Dec 31, 2010

I have totally exhausted my search to find IPBlock. I use it on my other Ubuntu machines but for some strange reason I cannot find it anywhere for my Ubuntu 10.10 Maverick. I know where the iplist is but not the actual file IPBlock download

View 2 Replies View Related

Ubuntu Networking :: What Is For "Search Domains:" Field In NetworkManager

Sep 4, 2010

I searched over the INTERNET but I can't get an exhaustive description of that function ("Search domains:"). Are you able to explain to me what it is for?

View 4 Replies View Related

Ubuntu :: Multiple File Search \ Search A File For A Certain Keyword?

Nov 13, 2010

for example we search a file for a certain keyword..is there any application available which will enable us to search for a single keyword in all the files within the folder ?i want to search for a keyword in about 1000 files..if i do it manually it will take loads of time..

View 6 Replies View Related

General :: Find/search Root Partition ONLY?

Jun 11, 2010

Say I need to do: find / -name somefile.txt

And say root partition / is mounted on /dev/sda5; however, let's say I also have 250GB partitions (/dev/sda6, /dev/sda7) mounted in /media - AND another location that I cannot currently remember. Say, also, that I know the file I'm looking for is on /dev/sda5.

Obviously, the above command will also descend in /media and that other directory which represent the big partitions, wasting time in looking for the file in the wrong place.

Is there a way to instruct find (or other command) to search only / on /dev/sda5, and NOT to descend to directories if they are on different partitions ?

View 1 Replies View Related

Programming :: Find A Field And Print Its Companion?

Apr 5, 2010

I have a file with variable length lines containing fields separated by colons:

Code:
path/to/file0.c:4150:109:4151:142:4153:275
path/to/file1.c:4040:109
path/to/file2.c:4605:72:4606:109
path/to/file3.c:4380:54

The first field identifies the file name, the second is the search key, and the third is the line number of the file that the search key points to. Any subsequent fields are other key/line number pairs.

As an example, I can search for 4151 (key) from my bash script to identify the file I will have to access, but I also need to capture the line (142) as well, and I can't figure out how to do that using grep, awk or sed (or anything else).

View 2 Replies View Related

Programming :: Gawk - Using Variable In Search Pattern?

Apr 4, 2010

yes, this is a homework question, but no - I'm not trying to get anyone to do it for me. I think that I am really close, but can't quite get one small aspect to work. in gawk, I want to include a variable name in the search string, but the below code doesn't work.

read -p 'Login name please? ' uLogName
userID=$(gawk -F: '/"$uLogName"/{print $3}' /etc/passwd)
echo $userID

[code]...

View 3 Replies View Related

General :: Case Insensitive Search From Find Command?

Apr 29, 2011

I am not able to figure out how can I do case-insensitive search using the find command.

I tried

find . -name -i pattern

And it does not work.

View 2 Replies View Related

General :: Find Command To Search Wildcard In Path?

Dec 8, 2009

I need a command to search for any file in a directory like so:

/home/*/upload/* and then change permissions any file in that directory.

Find doesn't seem to match what I need.

View 12 Replies View Related

General :: Using Find Command To Search For All Pictures, Or All Music?

May 17, 2010

Trying to find a way to have the find command perform a search using multiple file extensions such as "find all pics" i.e. .jpg, .png, .gif, .raw etc. I would have thought something like the following would have worked, but apparently I'm doing something wrong:

sudo find / -type f -iname "*.jpg" "*.png" "*.gif" -printf

I'm guessing find simply doesn't support more than one "-name/-iname" at a time? Or perhaps I'm going about this the wrong way? I realize most times there's several different ways to skin a cat when a task is requested in linux/unix.

View 5 Replies View Related

General :: Create An Interface That Belongs To Jdoe Only?

Jun 3, 2011

So Linux does an excellent job in managing rights per user. You all know the file and process management.

But is it also possible to create a virtual private network interface?

Say Linux user John Doe (jdoe) wants to test network software without being root and disturbing the real netif. Can you create an interface that belongs to jdoe only? Like eth0, eth1 and ethJdoe, making ethJdoe belonging to jdoe.

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

Programming :: Awk - Print A Field When Field Position Is Unknown ?

Mar 28, 2010

I'm trying to display fields from flat files where the first 8 fields are always the same. Fields 9 - n are varied but will contain specific patterns I'm after. I'm using this so far because "mySearch" is on each line I want to examine.

Code:

How would you pattern match and include 2 additional fields above field $9 but change field position from line to line?

View 12 Replies View Related

Ubuntu :: Desktop Search Dead \ Trying To Find A Good Desktop Search Tool?

Jun 16, 2011

I'm trying to find a good desktop search tool. Beagle is dead, Recoll and Strigi are KDE, and Tracker is not many features (can't even search Thunderbird 3). Do I miss something? Is desktop search on Linux dead? Should I use Google Desktop Search instead

View 2 Replies View Related

General :: Text Manipulation Find / Replace Variable Efficiency?

Aug 27, 2010

What I have works, but wondering what is the 'right' way to replace the digits with the letters given in this loop? somehow use a case or multiple sed? i thought of a multiple sed or a case but couldn't get it to work

Code:

# ...
bcv=$(echo $line | awk -F" " '{ print $1 }' | sed 's/1/q/g;s/2/w/g;s/3/e/g') # and so on

Code:

while read line
do
bcv=$(echo $line | awk -F" " '{ print $1 }')
if [ $bcv == "" ]

[code].....

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

General :: Fedora - Determine Which Process Belongs To Which Window In Monitor?

Feb 26, 2011

I have Fedora Linux 13 64bit system. I use System Monitor to check which process is taking how much memory and cpu. Normally I have dozens of Chrome and Firefox windows open. The Processes tab shows which process is taking how much cpu/ram resources but I unfortunately there is no option like right click and make the window active that matches the PID (the one process that I have currently highlighted). Usually there is a chrome process taking up 30 or 40 percent of CPU while dozens other chrome processes taking much less cpu. I must determine which chrome window ( or any application which has multiple instances running) is taking that much CPU time.

View 1 Replies View Related

General :: Given A File Path Search For File Exist?

Jan 27, 2011

I have file which consists of many files with their path,i need to check for the file exists in the given path,how to check?

View 12 Replies View Related

General :: How To Search File At Server

Jul 16, 2010

1. i want to make backup database(use mysqldump)

2. copy from server(use linux-server) to client PC (use linux- ubuntu 9.0)..

3. before that i want to search that DB file using terminal..

4. bcoz i dont know where the files are located

View 2 Replies View Related







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