Hi Corona, i have posted the contents of lineno using echo. it has "1"
Humor me... We don't know that it's not 1 or 1\r or what have you. In fact, do it like this:
Your error messages in particular make me very very suspicious that a carriage return got into your statement somehow:
Look at that "ed". It said 'sed' until a carriage return kicked the cursor back to the beginning of the line, then overwrite the s with the ending '. I'd interpret that as sed: -e expression #1, char 2: unknown command: `\r'
Where do you get the value for your ${lineno} variable?
Hey guys,
I'd like to delete all text within a text file without actually deleting the file. Is there a vi command I can do from my prompt without actually going into the file and doing a %d i think it is... to remove all the text inside?
I want to add this to a cron job to erase all the data... (2 Replies)
Hi
We had 3 server -hp112and hp146 here hp112 is production server and hp146 is staging server used for load.
when i am trying to run follwing command
rcp abc hp112:/dnbusr1/gbid/gbid02 it's trowing an error :-
remshd: Login incorrect.
But same command is working wise versa -
rcp abc... (1 Reply)
cat file.txt
fvnuiehuewf
ruevhxncvkjrh
zxjvurhfuwe
jkhvBEGINvfnvf
ijrgioe
Trying to delete a line that has the pattern "BEGIN"
cat sedtest
filename=file.txt
pattern=BEGIN
sed "/^$pattern/d" "$filename" (9 Replies)
Hi
Is it possible to do the following in a single command
/usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt
/usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt
exit (1 Reply)
How to use Mailx command in unix shell script, its throwing below error
#!/bin/ksh
let x=3
If ; then
mailx -s “ $x is greater than 2” example@gmail.com << EOF
This is the message body
EOF
fi
its throwing error as syntax error at EOF... (10 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've gotten a plugin script that won't run. I keeps throwing an error at the following line.
for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"`
do
#something
done
The error reads
... (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... (4 Replies)
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Hi,
I have a shell script which has a for loop that scans list of files and do find and replace few variables using sed command. While doing this, it deletes the last line of all input file which is something wrong. how to fix this. please suggest. When i add an empty line in all my input file,... (5 Replies)
Discussion started by: rbalaj16
5 Replies
LEARN ABOUT CENTOS
set_matchpathcon_invalidcon
set_matchpathcon_flags(3) SELinux API documentation set_matchpathcon_flags(3)NAME
set_matchpathcon_flags, set_matchpathcon_invalidcon, set_matchpathcon_printf - set flags controlling the operation of matchpathcon or
matchpathcon_index and configure the behaviour of validity checking and error displaying
SYNOPSIS
#include <selinux/selinux.h>
void set_matchpathcon_flags(unsigned int flags);
void set_matchpathcon_invalidcon(int (*f)(const char *path, unsigned lineno, char *context));
void set_matchpathcon_printf(void (*f)(const char *fmt, ...));
DESCRIPTION
set_matchpathcon_flags() sets the flags controlling the operation of matchpathcon_init(3) and subsequently matchpathcon_index(3) or match-
pathcon(3). If the MATCHPATHCON_BASEONLY flag is set, then only the base file contexts configuration file will be processed, not any
dynamically generated entries or local customizations.
set_matchpathcon_invalidcon() sets the function used by matchpathcon_init(3) when checking the validity of a context in the file contexts
configuration. If not set, then this defaults to a test based on security_check_context(3), which checks validity against the active pol-
icy on a SELinux system. This can be set to instead perform checking based on a binary policy file, e.g. using sepol_check_context(3), as
is done by setfiles -c. The function is also responsible for reporting any such error, and may include the path and lineno in such error
messages.
set_matchpathcon_printf() sets the function used by matchpathcon_init(3) when displaying errors about the file contexts configuration. If
not set, then this defaults to fprintf(stderr, fmt, ...). This can be set to redirect error reporting to a different destination.
RETURN VALUE
Returns zero on success or -1 otherwise.
SEE ALSO selinux(8), matchpathcon(3), matchpathcon_index(3), set_matchpathcon_invalidcon(3), set_matchpathcon_printf(3), freecon(3), setfilecon(3),
setfscreatecon(3)sds@tycho.nsa.gov 21 November 2009 set_matchpathcon_flags(3)