11-17-2014
How about combining your two first attempts?
And, your third attempt should work, too, if the pattern were formulated carefully.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Everyone,
I got a simple question. I'm trying to write a shell that looks for a file that arived ftp area and keeps looking until it find it.
It should look for the file that begins with test and then when it finds it. It starts the wmdaten.sh shell. All i got is that it runs... (5 Replies)
Discussion started by: Peterh
5 Replies
2. Shell Programming and Scripting
Hi,
I am new to shell script. Can you please tell me, whether can we specify font type and color in a shell script? If so, how to do this?
Thanks in advance. (4 Replies)
Discussion started by: Vani_Govind
4 Replies
3. Shell Programming and Scripting
I am writing a unix shell script that will extract records from table and write into a file.
======================================
#! /bin/ksh
############################
# AFI Monitor Script
############################
. /db2/uszlad48/sqllib/db2profile
export... (5 Replies)
Discussion started by: kmanivan82
5 Replies
4. Shell Programming and Scripting
Hello All,
I want to type some special characters to check in my shell script as string. Could you please help me how do I type in my shell script. For example "LA CORUĆA". Here the last but 1 character is related to ISO_8859_1 related. But don't know how do I type in shell script programming.... (3 Replies)
Discussion started by: nvkuriseti
3 Replies
5. Shell Programming and Scripting
Hey guys - i have a script (below) that searches for current files in a particular directory.
However i was wondering how to make it search for "yesterdays" file. For instance it looks for a file from yesterday and no older than that.
I used stat command to check for file information:
... (6 Replies)
Discussion started by: DallasT
6 Replies
6. UNIX for Dummies Questions & Answers
Hi,
Below is some code that I would like to implement however I am getting these errors: (what I am attempting to do is to check if a zip file has ascii files and if ascii and not binary then move the ascii files to a folder. some of the files are in xml format but are ascii and i will be moving... (0 Replies)
Discussion started by: bwcberb
0 Replies
7. Shell Programming and Scripting
Right, noob to shell scripting, playing a round for practice, wrote the following but it doesn't seem to work as expected, how could I fix/improve this script?
#!/bin/bash
#set -v
#set -x
case $# in
1)
echo Searching for $1 in '*';
find . -iname '*' 2>/dev/null | xargs grep "$1" -sl... (3 Replies)
Discussion started by: Pezmc
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting. I need a bash shell scripts which search and grep a parameter value from input.txt file and insert it in between two semicolon of second line of output.txt file.
For example
The shell script search an IP address as parameter value from input.txt ... (2 Replies)
Discussion started by: sunilkumarsinha
2 Replies
9. Shell Programming and Scripting
Hi,
I have a file with few values in it. I need script help to read file line by line and check:
1/if it's a file (with extension eg .java .css .jar etc )
or
2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies
10. Shell Programming and Scripting
Hello,
I supposed that it was working fine but now I see that it's not working as expected.
I am running under ubuntu14.04, trusty.
My plan was to search folderA and all subdirectories and move any txt file to destination folder, folderB :
find /home/user/folderA/ -type f -iname "*.txt"... (0 Replies)
Discussion started by: baris35
0 Replies
LEARN ABOUT OPENDARWIN
scotty
scotty(1) Tnm Tcl Extension scotty(1)
__________________________________________________________________________________________________________________________________________________
NAME
scotty - A Tcl shell including the Tnm extensions.
SYNOPSIS
scotty ?fileName arg arg ...?
_________________________________________________________________
DESCRIPTION
scotty is a Tcl interpreter with extensions to obtain status and configuration information about TCP/IP networks. After startup, scotty
evaluates the commands stored in .scottyrc and .tclshrc in the home directory of the user.
SCRIPT FILES
If scotty is invoked with arguments then the first argument is the name of a script file and any additional arguments are made available to
the script as variables (see below). Instead of reading commands from standard input scotty will read Tcl commands from the named file;
scotty will exit when it reaches the end of the file.
If you create a Tcl script in a file whose first line is
#!/usr/local/bin/scotty2.1.11
then you can invoke the script file directly from your shell if you mark the file as executable. This assumes that scotty has been
installed in the default location in /usr/local/bin; if it's installed somewhere else then you'll have to modify the above line to match.
Many UNIX systems do not allow the #! line to exceed about 30 characters in length, so be sure that the scotty executable can be accessed
with a short file name.
An even better approach is to start your script files with the following three lines:
#!/bin/sh
# the next line restarts using scotty
exec scotty2.1.11 "$0" "$@"
This approach has three advantages over the approach in the previous paragraph. First, the location of the scotty binary doesn't have to
be hard-wired into the script: it can be anywhere in your shell search path. Second, it gets around the 30-character file name limit in
the previous approach. Third, this approach will work even if scotty is itself a shell script (this is done on some systems in order to
handle multiple architectures or operating systems: the scotty script selects one of several binaries to run). The three lines cause both
sh and scotty to process the script, but the exec is only executed by sh. sh processes the script first; it treats the second line as a
comment and executes the third line. The exec statement cause the shell to stop processing and instead to start up scotty to reprocess the
entire script. When scotty starts up, it treats all three lines as comments, since the backslash at the end of the second line causes the
third line to be treated as part of the comment on the second line.
VARIABLES
Scotty sets the following Tcl variables:
argc Contains a count of the number of arg arguments (0 if none), not including the name of the script file.
argv Contains a Tcl list whose elements are the arg arguments, in order, or an empty string if there are no arg arguments.
argv0 Contains fileName if it was specified. Otherwise, contains the name by which scotty was invoked.
tcl_interactive Contains 1 if scotty is running interactively (no fileName was specified and standard input is a terminal-like device), 0
otherwise.
PROMPTS
When scotty is invoked interactively it normally prompts for each command with ``% ''. You can change the prompt by setting the variables
tcl_prompt1 and tcl_prompt2. If variable tcl_prompt1 exists then it must consist of a Tcl script to output a prompt; instead of out-
putting a prompt scotty will evaluate the script in tcl_prompt1. The variable tcl_prompt2 is used in a similar way when a newline is typed
but the current command isn't yet complete; if tcl_prompt2 isn't set then no prompt is output for incomplete commands.
SEE ALSO
Tnm(n), Tcl(n)
AUTHORS
Juergen Schoenwaelder <schoenw@cs.utwente.nl>
Tnm scotty(1)