Search Results

Search: Posts Made By: eltinator
6,456
Posted By eltinator
Hi, so thanks for the input everyone. To clarify,...
Hi, so thanks for the input everyone. To clarify, in my input file the 0 is just an example of the data I want to replace, this can be text or other numbers or a combination of both. I have a loop...
6,456
Posted By eltinator
Sure, so here would be my text file before. Let's...
Sure, so here would be my text file before. Let's just say I have a file of serial numbers:

E1111111
E2222222
E3333333
0
E5555555
0
E7777777

So the 0 are mess ups in the file and I want...
6,456
Posted By eltinator
Sed on first instance only
Hi, I've been trying to figure this one out and found a post about this on the forum here but the solution didn't seem to work for me. Basically what I have is a file that looks something like:
...
2,564
Posted By eltinator
Testing for multiple words in a Variable
Hi,

Been mulling this one over today and can't seem to find the exact method to solve this. So I assign a value to a variable based on a grep. Usually that variable has 1 value but today I...
2,333
Posted By eltinator
Thanks for the quick response but do I need to...
Thanks for the quick response but do I need to have the [[ ]] around the condition? I'm getting a syntax error:

./Compare.sh: line 9: conditional binary operator expected
./Compare.sh: line 9:...
2,333
Posted By eltinator
if condition for variable existing in file
Hi, Sorry for the dumb question but I can't seem to figure this one out. I want to write an if condition that basically checks if my variable is in a file. So far I have the following:

if [[ grep...
39,564
Posted By eltinator
Replace comma with newline
Hi, for some reason I cant seem to figure this out. I have a file which looks something like this

word
word
word
word
word,word,word
word
word
word,word,word,word,word
word
word
...
12,836
Posted By eltinator
Awesome! One more thing I forgot to mention, the...
Awesome! One more thing I forgot to mention, the number I want is surrounded by "". How can I get rid of those quotation marks? Thanks so much!
12,836
Posted By eltinator
Grep Out of a CSV
Hi, I have a CSV file and would like to grep out a particular row of values. The CSV file looks something like...

"email", "data", "date", "other data", "blah", "NUMBER I WANT", "more stuff", and...
14,729
Posted By eltinator
cool thanks for the help =D
cool thanks for the help =D
14,729
Posted By eltinator
hmm the -ow option didnt seem to work. I tried...
hmm the -ow option didnt seem to work. I tried changing the ordering of it too but it didnt return anything at all. Do I need to pipe it or anything?
14,729
Posted By eltinator
grep for word
Hi, I'm a little confused with the grep options and can't seem to find the correct one I need. I basically want to grep a file for a word with the pattern in it. I tried:

grep -w word file

But...
8,319
Posted By eltinator
Calling a shell script from php
Hi,

I have a shell script and I'm trying to execute it from my php script. The command I'm using is:


shell_exec("Script.sh");


Is this correct? It seems to not do anything for me. Not...
11,752
Posted By eltinator
Ahh that's what it was! Good catch! Thanks...
Ahh that's what it was! Good catch! Thanks everyone for all the help =D
11,752
Posted By eltinator
no luck as in it didn't do anything. no error and...
no luck as in it didn't do anything. no error and didn't produce the right result. I'll paste the script so maybe u can see if other things are causing issues

#!/bin/sh
name=$(grep ENGINE radar)...
11,752
Posted By eltinator
thanks but still no luck. What did you mean by...
thanks but still no luck. What did you mean by the red # symbol?
11,752
Posted By eltinator
It's something with this syntax: ...
It's something with this syntax:

<ticket://abc/43289324> hdsbdkdsa
11,752
Posted By eltinator
Hmm, seems to be giving me this problem now: ...
Hmm, seems to be giving me this problem now:

bad flag in substitute command: 'r'

I tried with and without the double quotes. I tried with single quotes around the sed and that didnt seem to do...
11,752
Posted By eltinator
so i've tried the following: sed...
so i've tried the following:

sed 's/\$name/newname/g' file

and

sed 's/\$name\/newname/g' file

which doesn't error out but doesn't do anything either. I think the problem is that the...
11,752
Posted By eltinator
ah ok cool thanks! But one more problem and i...
ah ok cool thanks! But one more problem and i believe it has to do with something im substituting in. The variable $name contains something like... "<stuff>morestuff" without the quotes of course. I...
11,752
Posted By eltinator
syntax for variables in sed
I always kind of wondered this but I have a variable that I want to use in a search and replace. Basically I want to search a file for the string in my variable and replace it with something fixed...
6,984
Posted By eltinator
storing result of a command in variable
For whatever reason I cant seem to fix my syntax to do the following. I want to run a grep and count how many instances come up and store that number in a variable but I keep erroring out. Here's my...
7,183
Posted By eltinator
not a problem, i can figure that out. thanks so...
not a problem, i can figure that out. thanks so much for the help! you rock!
7,183
Posted By eltinator
cool, got it! One last thing and this might not...
cool, got it! One last thing and this might not even matter since it's HTML but I guess it depends on what kind of space this is but the output seemed to have added a tab right before replacing a...
7,183
Posted By eltinator
This is what happened when I tried running the...
This is what happened when I tried running the command:

unix$ nl file1 |
> sed 's/^[ ]*\([1-9][0-9]*\)[ ]*\([^ ].*\)/s%\\$\1%\2%g/' |
> sed -f - file2
sed: -: No such file or directory
Showing results 1 to 25 of 63

 
All times are GMT -4. The time now is 03:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy