07-01-2016
The script I posted has 23 lines, so it is difficult to track an error in line 24 without seeing a) the script you ran b) the input file (or a representative extraction of it).
You could run it with <TAB>s and then tr '\t' '|' the result.
10 More Discussions You Might Find Interesting
1. Programming
I'm implementing a shell in C that supports piping, output redirection, and background processing, and a few other commands. I was wondering how I'd go about implementing the output redirection. So, I'd open a file and I'd fork and execute the command. But how would I get stdout into the file? Any... (10 Replies)
Discussion started by: ununium
10 Replies
2. Programming
hello all,
i hv attached herewith my program to implement a simple interactive shell in C. no matter hw hard I try, I keep getting some errors. i need help - urgently !!
proj1test7.c: In function `parseCommand':
proj1test7.c:102: warning: assignment makes pointer from integer without a cast... (2 Replies)
Discussion started by: nix1209
2 Replies
3. Programming
Hi,
I am implementing a shell in C, with the following problem...
Suppose the shell is invoked from the command line as
>> myshell < test.in > test.out 2>&1
I have to execute the commands in test.in and redirect them to test.out
How does one detect in the main function that the shell... (1 Reply)
Discussion started by: jacques83
1 Replies
4. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
need to implement mkdir, chdir, mv, pwd
given a shell.cpp directory.cpp and some other files
this shell missing these commands, and i need to implement them inside the shell
2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: evantheking
0 Replies
5. Shell Programming and Scripting
HI
I want to implement a control mechanism using Shell scripts .The intention is to have controlled number of jobs running in parallel
External process will kickstart 40 jobs in parallel .All the 40 jobs will call the same generic script with different parameter values .But at a... (4 Replies)
Discussion started by: police
4 Replies
6. Programming
Hello,
i'm trying to implement the times() function and i'm programming in C.
I'm using the "struct tms" structure which consists of the fields:
The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process.
The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies
7. Programming
I have this code where I have declared a struct with some functions. Trying to write the function implementation outside the struct declaration and do not know how to proceed.
#ifndef ParseEl_hh
#define ParseEl_hh
#include <iostream>
#include <fstream>
#include "DynBaseObj.hh"... (7 Replies)
Discussion started by: kristinu
7 Replies
8. Shell Programming and Scripting
Hey Guys,
My problem:
I have a script that will be querying the database every minute to see if it gets a response, the response its querying for is "UP" in a table i made called dbup in the database.
Now, I am trying to add the component to implement a timeout if the script does not get a... (2 Replies)
Discussion started by: mo_VERTICASQL
2 Replies
9. Shell Programming and Scripting
Hello Experts,
Is it possible to implement linked list in shell scripting? is yes then how can we do it? Any working example is highly appreciated.
Thanks in advance. (4 Replies)
Discussion started by: mukulverma2408
4 Replies
10. UNIX for Beginners Questions & Answers
I am using DB2 v9 and trying to get country values in comma seperated format using below query
SELECT distinct LISTAGG(COUNTRIES, ',') WITHIN GROUP(ORDER BY EMPLOYEE)
FROM LOCATION ;
Output Achieved
MEXICO,UNITED STATES,INDIA,JAPAN,UNITED KINGDOM,MEXICO,UNITED STATES
The table... (4 Replies)
Discussion started by: Perlbaby
4 Replies
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)