Hi guys, I am new here. I have done many scripts in VisualBasic and batch.
Now going to *inux and learning bash and perl, quite amazing commands I find in linux, like sed, grep, awk and so on...
the task is simple, find a string in folders and remove the line where that string exists.
I can... (3 Replies)
Hi All,
I have a file from Mainframe which has one of the lines with so many words... i tried to fold, format to 80 chararcter.. stil did not work. So i have decided to search for a string in that line Ex.FLIGHT PLAN and once if it is found i want to delete the entire line.
Please help... (2 Replies)
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 in the file:
*.cat;dog;kennel;house;barn;horse;hay;coat hat
and remove the "coat" from the... (12 Replies)
I am using a while loop to read a file and i have to delete a string from the last line. Here is the code so far:
1. Read line by line from file new.html using while loop and store in a variable data
2.Now, need to replace '||chr( from last line in data
I am able to replace that character from... (12 Replies)
I have code that accepts input from a user, and when the user hits enter it is supposed to delete that whole line from the file.
echo "Which record? "
read record
sed '/$record/d' file
However, it does not delete it. Any help? (1 Reply)
Hi,
How to delete the last line if is match the below string else no action...
String checking "END OF FILE. ROW COUNT: "
9f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|2
9f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|0
229f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|3
END OF... (2 Replies)
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)
Hello,
When my lines contain question mark, I use below command to delete the portion of the matching line coming after question mark:
sed 's/?.*//' SampleFile
SampleFile:
helloworldfirstline?mdksmyymsss
hellosecondlineworld?mdksmkkmsss
thirdhelloworld?mdksmccmsss
Output:... (2 Replies)
Discussion started by: baris35
2 Replies
LEARN ABOUT CENTOS
telinit
TELINIT(8) telinit TELINIT(8)NAME
telinit - Change SysV runlevel
SYNOPSIS
telinit [OPTIONS...] {COMMAND}
DESCRIPTION
telinit may be used to change the SysV system runlevel. Since the concept of SysV runlevels is obsolete the runlevel requests will be
transparently translated into systemd unit activation requests.
OPTIONS
The following options are understood:
--help
Prints a short help text and exits.
--no-wall
Do not send wall message before reboot/halt/power-off.
The following commands are understood:
0
Power-off the machine. This is translated into an activation request for poweroff.target and is equivalent to systemctl poweroff.
6
Reboot the machine. This is translated into an activation request for reboot.target and is equivalent to systemctl reboot.
2, 3, 4, 5
Change the SysV runlevel. This is translated into an activation request for runlevel2.target, runlevel3.target, ... and is equivalent
to systemctl isolate runlevel2.target, systemctl isolate runlevel3.target, ...
1, s, S
Change into system rescue mode. This is translated into an activation request for rescue.target and is equivalent to systemctl rescue.
q, Q
Reload daemon configuration. This is equivalent to systemctl daemon-reload.
u, U
Serialize state, reexecute daemon and deserialize state again. This is equivalent to systemctl daemon-reexec.
EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise.
NOTES
This is a legacy command available for compatibility only. It should not be used anymore, as the concept of runlevels is obsolete.
SEE ALSO systemd(1), systemctl(1), wall(1)systemd 208TELINIT(8)