Search Results

Search: Posts Made By: Jazmania
2,604
Posted By Jazmania
Match on a range of numbers
Hi,
I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would..

Can some one tell me...
3,334
Posted By Jazmania
How to use sed when a match has forward slashes
I'm trying to replace an alias with its match using sed but the match contains forward slashs so it causes the sed command to throw a garbled message..


cmd_list.txt sample

...
4,785
Posted By Jazmania
Thats what I've been trying but it keeps...
Thats what I've been trying but it keeps assigning all match to the variable where as I want it to cycle through each match and assign it to the variable

Think this will do it

counter=1...
4,785
Posted By Jazmania
Assign grep match to variable question
Hi,

I'm trying to assign a grep result to a variable but instead of having all grep result's assigned to the variable, would it be possible to assign the first match, do something, then move onto...
6,148
Posted By Jazmania
Hi Scott, I'm getting the below error when I...
Hi Scott,

I'm getting the below error when I try and run your loop suggestion.. Running this on Solaris so maybe the syntax is slightly different

ksh: syntax error: `=~' unexpected

Edit--
...
6,148
Posted By Jazmania
How to print everything after a string match
Hi all,

I'm trying to do some work on the authorized_keys file to do a check if there's any information after the hash key.. At the end of the hash key's in the file, there can be an = or ==

Is...
1,055
Posted By Jazmania
If statement not matching correctly
Hi,
When I run the below if statement it keeps returning a yes even though it should be returning a no.. I'm not sure why this is happening.. Can anyone shed some light.?


if [[...
5,159
Posted By Jazmania
Apologies for the double post here... Is...
Apologies for the double post here...

Is there a way though to anchor whats being replaced.. For example I'm replacing an alias called IBM with what it matches in the $cmdfile but its also...
1,172
Posted By Jazmania
Using ksh and its solaris.. In the end i just did...
Using ksh and its solaris.. In the end i just did the below and it got around it..

groupsvar1=$SUDOREP_WORK/$groupsvar; export groupsvar1


However its not what I hoped it would be...


What...
1,172
Posted By Jazmania
But if I echo out ${groupsvar} after the do it is...
But if I echo out ${groupsvar} after the do it is returning the correct data..
1,172
Posted By Jazmania
Nawk variable question
Hi,
I'm trying to replace a string with the contents of a file.. I found the below thread that shows how to do this but is there any way to use a variable as the file name in the nawk command?.....
1,212
Posted By Jazmania
I'll admit it aint the prettiest piece of code...
I'll admit it aint the prettiest piece of code ever but it half works and I'm under pressure to get this script finished for the business..

I've 4 files I'm working with here..
...
1,164
Posted By Jazmania
Hi, Guessing you'd need something like this......
Hi,
Guessing you'd need something like this...

COLUMN_NO=$1

case $COLUMN_NO in
column_1 )
awk -F [ ' '] ' { print $1, $2, $3, $4, $5, $6' } < yourfilename
;;
...
1,212
Posted By Jazmania
If with sed loop question
Hi,

$list_A contains a list of user ID's.
$pwdfile_new is the unix password file.
$useralias is a report file

I'm trying to search through the password file with the list in list_A and...
4,888
Posted By Jazmania
echoing out the results was good advice... I...
echoing out the results was good advice... I needed to replace $j with $j$.. The grep was picking up multiples..

Thanks everyone for the help...
4,888
Posted By Jazmania
Hi, the garbled command is showing what i...
Hi,
the garbled command is showing what i need.. I'm trying to replace

CCMAIL with CCMAIL=wa990097 but i don't know why it won't do it.. It works for files I'm working with..
4,888
Posted By Jazmania
Hi bakunin, I tried the first way you gave...
Hi bakunin,

I tried the first way you gave and it still doesn't seem to fix the issue.. (Although it did help me out further down my script..) Can't figure out why it stalls on one particular...
4,888
Posted By Jazmania
Hi thanks for the response.. I do understand that...
Hi thanks for the response.. I do understand that sed has some characters that are special to the command language..

I don't quite see how your above example would fit into my for loop?

Are you...
4,888
Posted By Jazmania
Sed command garbled question
for j in $(cat ${list_B})
do
to_replace_2=$(grep $j ${useralias}_2)
sed "s/^${j}/${to_replace_2}/p" ${entries} > ${entries}_2
mv ${entries}_2 ${entries}
done


Hi,
I've the above sed command...
5,159
Posted By Jazmania
Yep, that seems to of done it alright... Many...
Yep, that seems to of done it alright... Many thanks for your help..

EDIT**

Actually one more thing.. $1 is referencing a command like the following

When I do the following awk command on a...
5,159
Posted By Jazmania
Awk FNR==NR question
awk -F'[ =]' 'FNR==NR {a[$1]=$2; next} {$1=a[$1]} 1' $useralias ${entries} >> ${entries}_2

Hi,
Is there anyway to alter this command so that if it does not find a match it will just leave the...
1,931
Posted By Jazmania
Matching user alias's to their ID's in the passwd file
Hi,
I've a user alias file in the below format.. I need to change all the ID's that come after the = sign (with some multiple ID's which are separated by comma's) to their respective users that are...
7,027
Posted By Jazmania
Hmmm, tried that but it doesn't copy the line...
Hmmm, tried that but it doesn't copy the line that begins with root to the vintella.sudoers_1 file..

Thanks for replying though..



EDIT**

Hi,
Is there anyway to alter this command so...
7,027
Posted By Jazmania
Tried the above but got the following error:- ...
Tried the above but got the following error:-

syntax error at line 1 : `(' unexpected


EDIT**

Hi alister..
I just tried your command this time but added /usr/xpg4/bin/ to the begin of it...
7,027
Posted By Jazmania
Hi, Best way to show I guess is to give a few...
Hi,
Best way to show I guess is to give a few lines of each file.. I want to replace field 1 of vintella.sudoers_1 with field 2 of what it matches in vintella.sudoers_useralias

vintella.sudoers_1...
Showing results 1 to 25 of 112

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