Sponsored Content
Top Forums UNIX for Dummies Questions & Answers BASH: Interactive "cp" (and "mv") in a loop Post 302504427 by SilversleevesX on Monday 14th of March 2011 02:36:57 PM
Old 03-14-2011
Corona688:

Thanks for the help. It works great.

BZT
This User Gave Thanks to SilversleevesX For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

5. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

6. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
Tcl_Main(3)						      Tcl Library Procedures						       Tcl_Main(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_Main, Tcl_SetMainLoop - main program and event loop definition for Tcl-based applications SYNOPSIS
#include <tcl.h> Tcl_Main(argc, argv, appInitProc) Tcl_SetMainLoop(mainLoopProc) ARGUMENTS
int argc (in) Number of elements in argv. char *argv[] (in) Array of strings containing command-line arguments. Tcl_AppInitProc *appInitProc (in) Address of an application-specific initialization procedure. The value for this argument is usually Tcl_AppInit. Tcl_MainLoopProc *mainLoopProc (in) Address of an application-specific event loop procedure. _________________________________________________________________ DESCRIPTION
Tcl_Main can serve as the main program for Tcl-based shell applications. A ``shell application'' is a program like tclsh or wish that sup- ports both interactive interpretation of Tcl and evaluation of a script contained in a file given as a command line argument. Tcl_Main is offered as a convenience to developers of shell applications, so they do not have to reproduce all of the code for proper initialization of the Tcl library and interactive shell operation. Other styles of embedding Tcl in an application are not supported by Tcl_Main. Those must be achieved by calling lower level functions in the Tcl library directly. The Tcl_Main function has been offered by the Tcl library since release Tcl 7.4. In older releases of Tcl, the Tcl library itself defined a function main, but that lacks flexibility of embedding style and having a function main in a library (particularly a shared library) causes problems on many systems. Having main in the Tcl library would also make it hard to use Tcl in C++ programs, since C++ programs must have special C++ main functions. Normally each shell application contains a small main function that does nothing but invoke Tcl_Main. Tcl_Main then does all the work of creating and running a tclsh-like application. Tcl_Main is not provided by the public interface of Tcl's stub library. Programs that call Tcl_Main must be linked against the standard Tcl library. Extensions (stub-enabled or not) are not intended to call Tcl_Main. Tcl_Main is not thread-safe. It should only be called by a single master thread of a multi-threaded application. This restriction is not a problem with normal use described above. Tcl_Main and therefore all applications based upon it, like tclsh, use Tcl_GetStdChannel to initialize the standard channels to their default values. See Tcl_StandardChannels for more information. Tcl_Main supports two modes of operation, depending on the values of argc and argv. If argv[1] exists and does not begin with the charac- ter -, it is taken to be the name of a file containing a startup script, which Tcl_Main will attempt to evaluate. Otherwise, Tcl_Main will enter an interactive mode. In either mode, Tcl_Main will define in its master interpreter the Tcl variables argc, argv, argv0, and tcl_interactive, as described in the documentation for tclsh. When it has finished its own initialization, but before it processes commands, Tcl_Main calls the procedure given by the appInitProc argu- ment. This procedure provides a ``hook'' for the application to perform its own initialization of the interpreter created by Tcl_Main, such as defining application-specific commands. The procedure must have an interface that matches the type Tcl_AppInitProc: typedef int Tcl_AppInitProc(Tcl_Interp *interp); AppInitProc is almost always a pointer to Tcl_AppInit; for more details on this procedure, see the documentation for Tcl_AppInit. When the appInitProc is finished, Tcl_Main enters one of its two modes. If a startup script has been provided, Tcl_Main attempts to evalu- ate it. Otherwise, interactive mode begins with examination of the variable tcl_rcFileName in the master interpreter. If that variable exists and holds the name of a readable file, the contents of that file are evaluated in the master interpreter. Then interactive opera- tions begin, with prompts and command evaluation results written to the standard output channel, and commands read from the standard input channel and then evaluated. The prompts written to the standard output channel may be customized by defining the Tcl variables tcl_prompt1 and tcl_prompt2 as described in the documentation for tclsh. The prompts and command evaluation results are written to the standard output channel only if the Tcl variable tcl_interactive in the master interpreter holds a non-zero integer value. Tcl_SetMainLoop allows setting an event loop procedure to be run. This allows, for example, Tk to be dynamically loaded and set its event | loop. The event loop will run following the startup script. If you are in interactive mode, setting the main loop procedure will cause | the prompt to become fileevent based and then the loop procedure is called. When the loop procedure returns in interactive mode, interac- | tive operation will continue. The main loop procedure must have an interface that matches the type Tcl_MainLoopProc: | typedef void Tcl_MainLoopProc(void); | Tcl_Main does not return. Normally a program based on Tcl_Main will terminate when the exit command is evaluated. In interactive mode, if an EOF or channel error is encountered on the standard input channel, then Tcl_Main itself will evaluate the exit command after the main loop procedure (if any) returns. In non-interactive mode, after Tcl_Main evaluates the startup script, and the main loop procedure (if any) returns, Tcl_Main will also evaluate the exit command. SEE ALSO
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3), exit(n) KEYWORDS
application-specific initialization, command-line arguments, main program Tcl 8.4 Tcl_Main(3)
All times are GMT -4. The time now is 09:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy