Sponsored Content
Top Forums Shell Programming and Scripting trying to add an option to view before executing? Post 302140711 by llsmr777 on Monday 15th of October 2007 04:14:43 PM
Old 10-15-2007
trying to add an option to view before executing?

I am very new to scripting.

I have the following script:

for i in `ls -1 | grep $1 | grep -v $2`
do
x=`echo $i | sed 's/\.New/\.Old/g'`
echo mv $i DONE/$x
done

This is taking files from the directory I am in and changing the name from .New to .Old and then echoing the command to move it to a DONE directory.

So from here I want to know how can I add a little output that asks the user if what outputted to the screen is correct? And if it is go ahead and move and if not just cancel out.

Thank you for ANY replies!!
 

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

How to add Win2000, Win Me option to Lilo menu?

Hi All, I have installed RH Linux 7.1, windows 2000 and windows ME in the same machine. There are two booting menu: Lilo: Linux Dos Dos : Windows2000 WindowsME If I want to use windowME, I need to boot lilo and choose dos and final choose windows ME. Have any... (3 Replies)
Discussion started by: wilsonchan1000
3 Replies

2. UNIX for Dummies Questions & Answers

How to add the landscape option...

to an existing print que? (1 Reply)
Discussion started by: NycUnxer
1 Replies

3. Shell Programming and Scripting

How do I add the option to change the path in a menu?

How do I add the option to change the path in a menu? I have this script. The user chooses a number and had the option of doing something, looking for log files etc. There is a possibility they might want to look at a different path other than what I have given them such as... (2 Replies)
Discussion started by: taekwondo
2 Replies

4. Ubuntu

Add Option To Right Menu

hey all, I already installed nautilus-actions now , I want to add "print path" script(option) to the right context menu!.. I did : http://img853.imageshack.us/img853/6973/59818245.png http://img847.imageshack.us/img847/8758/37217230.png the script print located in... (2 Replies)
Discussion started by: eawedat
2 Replies

5. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

6. Shell Programming and Scripting

Add option to fstab

I need as script (awk/sed?) to add noatime option to fstab. It should append ,noatime to whatever is in column 4 if noatime isn't already there, leaving comments alone. input: # /etc/fstab # Created by anaconda on Mon Oct 31 20:44:41 2011 # # Accessible filesystems, by reference, are... (5 Replies)
Discussion started by: pblumenthal
5 Replies

7. UNIX for Dummies Questions & Answers

Executing a tar command with the --exclude option in a Debian shell script.

Hi All, I am trying to execute the following tar command with two --exclude options to suppress extract of the two directories specified. Do I need to single quote the directory paths ?? Many thanks for your help. The relevant code excerpt from the script is: cd /var/www/${SITE} ... (7 Replies)
Discussion started by: daveu7
7 Replies

8. Shell Programming and Scripting

How to add a Y/N option?

I want to be able to add to any script that gives the option to continue or not, after the the first loop thru and to keep giving you the option after the user answers "Y" then does their thing then gives that option again once done. I've been seeing examples online on how to do it, but not for it... (2 Replies)
Discussion started by: bud1738
2 Replies

9. What is on Your Mind?

Moving from Desktop View to Mobile View

See attached video for a demo on how to move back and forth from the desktop view to the mobile view. Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on. Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy