Need some help deleting words from a line which are not my "Keyword"
Hi, i'm currently new to scripting and need some help with my problem, so i'll jump right to it.
I have a file containing text, the file is pretty big so for the sake of this i'll just say this is the text:
What i would like to do is search the lines for the keyword "abc", and the lines which contain the keyword, I would like to delete the other words in the line. Thus leaving an output as such:
I've searched far and wide for a solution and came stuck, so im really hoping one of you guys could help me out.
Thank you for your time
Last edited by radoulov; 07-18-2010 at 12:16 PM..
Reason: Please use code tags!
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi All
I have a function in a linux script like this
clean_up()
{
db2 -x "UPDATE ${DB_SCHEMA_NAME}.ETL_DAILY SET ETL_STATUS = 'SUCCESSFUL' WHERE PROCESS_DATE = '${INT_RUN_DATE}' AND BATCH_NO = ${CM_BATCH} AND APP_ID = ${APP_ID} AND APP_VERSION = '${APP_VERSION}'" > ${TMPOUT}
... (3 Replies)
Hi
I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this
Enter the line to... (1 Reply)
Hi
I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this
Enter the line... (4 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Hi everybody,
I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o
My code:
#!/bin/sh
set -e
set -u
export IFS=
optl="Optl"
LOCSTORCLI="/opt/lsi/storcli/storcli"
($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
LEARN ABOUT MOJAVE
getsebool
getsebool(8) SELinux Command Line documentation getsebool(8)NAME
getsebool - get SELinux boolean value(s)
SYNOPSIS
getsebool [-a] [boolean]
DESCRIPTION
getsebool reports where a particular SELinux boolean or all SELinux booleans are on or off In certain situations a boolean can be in one
state with a pending change to the other state. getsebool will report this as a pending change. The pending value indicates the value
that will be applied upon the next boolean commit.
The setting of boolean values occurs in two stages; first the pending value is changed, then the booleans are committed, causing their
active values to become their pending values. This allows a group of booleans to be changed in a single transaction, by setting all of
their pending values as desired and then committing once.
OPTIONS -a Show all SELinux booleans.
SEE ALSO selinux(8), setsebool(8), booleans(8)AUTHOR
This manual page was written by Dan Walsh <dwalsh@redhat.com>. The program was written by Tresys Technology.
dwalsh@redhat.com 11 Aug 2004 getsebool(8)