The “Delete files or directories” selection should prompt for a list of files or directories to be deleted. The script asks user for confirmation before deleting a file or a whole directory. The script must perform reasonable argument validation.
I tried to read the list of files and directories in a string but it is pretty hard to split the string based on space and put them in an array and then check them one by one and delete them. Also I was thinking to run a while loop to ask user to enter the name of file and then delete it and again repeat the job but it is not a nice way.
would you give me some clue?
---------- Post updated at 02:13 AM ---------- Previous update was at 12:50 AM ----------
Hi all
Does anyone have a script that will allow me to stop inside a while read loop.
I want to pause the loop until a enter is pressed.
e.g.
While read line
do
echo something
if LINECOUNT > 40
then
read ENTER?"PRESS ENTER TO CONT..."
... (3 Replies)
hi, i will like to know whether awk command can ignore case?
i written a script that will take in user input and search for data on the 1st field from a text file.
echo -n "Title:"
read title
awk -F":" '$1~/'"$title"'/{print $0}' Filename
read ans
return
... (5 Replies)
Hi
I am new to writing script and want to use a Bash Piped while-read and read from user input.
if something happens on server.log then do while loop or if something happend on user input then do while loop.
Pseudocode something like:
tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Hi,
I am working on a script, which requests users to enter input.
Ex: read -p "Please enter your email id:" email
I don't want users skipping this entry, this has to be mandatory.I dont want to proceed without input.
I can do a check if variable $email is empty and proceed if not.But, i... (7 Replies)
Hi,
This query is a part of a much more lengthy script.
I wish to look for all the files in a folder named "data" which in this case has two files i.e. plan.war and agent.properties. For all the files found under data I wish to ask the user as to where they wish copy the files to.
Below,... (14 Replies)
Hi Experts,
Need your guidance for case statement. I tried many way but no success yet.Now my existing code is doing something like below. Each Line of the input file contains one test case.#!/bin/bash
FILE=$1
while read LINE; do
do COMMAND
done < $FILE
Now I want to modify the code... (6 Replies)
I'm having an issue with bash read input when using a case statement.
The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here.
defaultans=8hrs
read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Discussion started by: woodson2
5 Replies
LEARN ABOUT DEBIAN
runit
runit(8) System Manager's Manual runit(8)NAME
runit - a UNIX process no 1
SYNOPSIS
runit
DESCRIPTION
runit must be run as Unix process no 1. It performs the system's booting, running, and shutdown in three stages:
STAGE 1
runit runs /etc/runit/1 and waits for it to terminate. The system's one time tasks are done here. /etc/runit/1 has full control of
/dev/console to be able to start an emergency shell if the one time initialization tasks fail. If /etc/runit/1 crashes, or exits 100, runit
will skip stage 2 and enter stage 3.
STAGE 2
runit runs /etc/runit/2, which should not return until system shutdown; if it crashes, or exits 111, it will be restarted. Normally
/etc/runit/2 starts runsvdir(8). runit is able to handle the ctrl-alt-del keyboard request in stage 2, see below.
STAGE 3
If runit is told to shutdown the system, or stage 2 returns, it terminates stage 2 if it is running, and runs /etc/runit/3. The systems
tasks to shutdown and possibly halt or reboot the system are done here. If stage 3 returns, runit checks if the file /etc/runit/reboot
exists and has the execute by owner permission set. If so, the system is rebooted, it's halted otherwise.
CTRL-ALT-DEL
If runit receives the ctrl-alt-del keyboard request and the file /etc/runit/ctrlaltdel exists and has the execute by owner permission set,
runit runs /etc/runit/ctrlaltdel, waits for it to terminate, and then sends itself a CONT signal.
SIGNALS
runit only accepts signals in stage 2.
If runit receives a CONT signal and the file /etc/runit/stopit exists and has the execute by owner permission set, runit is told to shut-
down the system.
if runit receives an INT signal, a ctrl-alt-del keyboard request is triggered.
SEE ALSO runit-init(8), runsvdir(8), runsvchdir(8), sv(8), runsv(8), chpst(8), utmpset(8), svlogd(8)
http://smarden.org/runit/
AUTHOR
Gerrit Pape <pape@smarden.org>
runit(8)