Search Results

Search: Posts Made By: skunky
2,746
Posted By skunky
using nawk (yes, with Solaris), here's the error...
using nawk (yes, with Solaris), here's the error I get:

nawk: syntax error at source line 1
context is
!f && >>> /users_here/{sub(usera,* <<< ,),f=1}1
nawk: illegal statement at...
2,746
Posted By skunky
neither seem to work, get errors with both.
neither seem to work, get errors with both.
2,746
Posted By skunky
running this I get: awk: syntax error near...
running this I get:

awk: syntax error near line 1
awk: bailing out near line 1
2,746
Posted By skunky
running both "sed -i" commands results in: sed:...
running both "sed -i" commands results in:
sed: illegal option -- i
2,746
Posted By skunky
ok, I should have been a bit more clear. Some of...
ok, I should have been a bit more clear. Some of versions of this file can be varying on some machines. The one identical factor is that the line on every machine will start with 'users_here' (for...
2,746
Posted By skunky
Best way to edit a file
looking for a script or command to push out from a centralized machine to multiple machines. I have the software in place that will do this already, but I need to tell it what command to run on each...
2,390
Posted By skunky
ok, before i run this, if i use the same outfile...
ok, before i run this, if i use the same outfile as infile, will it just update the file and not delete everything else in the file?

---

bump, no help on this one???
2,390
Posted By skunky
thanks for the reply you two, but the thing is...
thanks for the reply you two, but the thing is that I don't want to output the file to a new file. I want to run this command on the file, and have it pull 'usera' and exit the file.

----------...
2,390
Posted By skunky
i got a "Badly formed address" error message...
i got a "Badly formed address" error message running that command??
2,390
Posted By skunky
bump, any help on this and the -i option?????
bump, any help on this and the -i option?????
2,390
Posted By skunky
hmmmm, i get this error when running that...
hmmmm, i get this error when running that command: sed: illegal option -- i
2,390
Posted By skunky
ah, yes i will want to remove the comma, but i...
ah, yes i will want to remove the comma, but i also don't want to output the file to a new file. i want to manipulate this file, remove the 'usera,' and exit the file. can this be done?
2,390
Posted By skunky
sed command
hi,

I'm looking for a sed command to delete one word in a string. so i have a file with text like this:

# this is my file
users_here[tab space]u1=usera,userb,userc
users_there[tab...
4,719
Posted By skunky
thing is, i only want the word 'coat' removed,...
thing is, i only want the word 'coat' removed, and the line left there.......

anyone know an easy sed command to search out the line with that exact string first, and then remove the word 'coat'...
4,719
Posted By skunky
while helpful, it's not what i'm trying to do. ...
while helpful, it's not what i'm trying to do.

i'm trying to search a file to find that one specific line (mentioned in the original post), remove 'coat' IF it's contained in the line, and leave...
4,719
Posted By skunky
hmmmm, didn't pull 'coat' out of the line...
hmmmm, didn't pull 'coat' out of the line :confused:

Seems like there should be some easier sed/grep&delete/awk commands to do this, but I'm not familiar, obv, with them

---------- Post...
4,719
Posted By skunky
Ok, that's what I thought, but I only want the...
Ok, that's what I thought, but I only want the instance of 'coat' in that specific line removed. I want all the other instances of 'coat' left alone. I should have been more clear to begin with.
4,719
Posted By skunky
thanks, but I think this might be missing...
thanks, but I think this might be missing something? I tested it like this:

sed 's/coat (tab) hat$/hat/' myfile > myfile

and it ended up deleting everything else in the file, and all i want...
4,719
Posted By skunky
Search for a line, delete a string in it
let me start out by saying i have ZERO exp with any kind of scripting, so sorry if this is really basic stuff.....

For example, I need to have a script that will search a file and find this line...
Showing results 1 to 19 of 19

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