10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hallo,
I try to write a program which processes an input-file linewise.
I created the following minimal example:
hash-problem:#!/bin/tcsh
foreach text ("`cat $1`")
echo $text
endUsually, it works as expected, but there are two problems:
1. If the argument of hash-problem has an... (3 Replies)
Discussion started by: DanielDD
3 Replies
2. Shell Programming and Scripting
Dear all,
I have piece of command from tcsh, which I would like to be in my .bashrc file.
However, I am comletely blank about the tcsh commandline.
if (-e ~/forum/dir/code.sh) then
source ~/forum/dir/code.sh
endif
Any piece of suggestions how to convert it to sh way?
Thank you
emily (5 Replies)
Discussion started by: emily
5 Replies
3. Shell Programming and Scripting
hi,
I am completely new for tcsh scripting. Trying to write a code, need to implement following function there,
perl -pi.bak -e 's/filei/file(i+1)/g' data
I want the "i" to increment and this should change the file name as
i = 1; file1->file2
i=2; file2->file3
and so on
also... (4 Replies)
Discussion started by: nrjrasaxena
4 Replies
4. Shell Programming and Scripting
Does anyone no way my .tcsh_history file is filling up with a bunch of crap?? It is filled with lines like:
! ls eccracrascratcd ! ls mecd /hchoo "cratch2/mecd /sch2/mecd /sh2/mecd /scratchcd /scratch2/mecd /scratcraecd /ls mo "ls" >
! ls eccratch2/mecd /sc/ls"d /scratch2/mecd histecho "ls" o... (2 Replies)
Discussion started by: Bic121
2 Replies
5. Shell Programming and Scripting
Hello,
I have a question regarding file naming under a loop in tcsh. I have the following code:
#!/bin/tcsh
foreach file (test/ProteinDirectory/*) # The * is a bunch of ProteinFile1, ProteinFile2, ProteinFile3, etc.
sh /bioinfo/home/dgendoo/THREADER/pGenThreader.sh $file $file
... (4 Replies)
Discussion started by: InfoSeeker
4 Replies
6. Shell Programming and Scripting
Hi!
I want to log out of the tcsh shell without updating the history?
Thanks,
Jack. (3 Replies)
Discussion started by: jacki
3 Replies
7. UNIX for Dummies Questions & Answers
Hello,
Why tcsh shell is not recommended ? then which one is better ?
Also can you please let me know how to change own shell and config file? (3 Replies)
Discussion started by: darshakraut
3 Replies
8. UNIX for Dummies Questions & Answers
Hi friends,
I have a script that sets the env variable path based on different conditions.
Now the new path variable setting should not done in the same terminal or same shell.
Only a new terminal or new shell should have the new path env variable set.
I am able to do this only as follows:
>cd... (1 Reply)
Discussion started by: sowmya005
1 Replies
9. UNIX for Dummies Questions & Answers
am working in tcsh
while writing a script, what is diff between foll two starting line
#!/bin/csh
#!/bin/csh -f
Also can I use the same line for script in tcsh or I have to necessarily use
#!/bin/tcsh
I guess even #!/bin/sh will also do. Kindly clarify (3 Replies)
Discussion started by: mahendrakamath
3 Replies
10. Shell Programming and Scripting
I'm working on OpenOffice Localization; In that I need to work most of in 'tcsh'
Since I have almost work till now in 'bash', I want to explore 'tcsh' much more ..
An body suggest me a way ? books ?
Thanks,
:) (1 Reply)
Discussion started by: kartik
1 Replies
history(1T) Tcl Built-In Commands history(1T)
__________________________________________________________________________________________________________________________________________________
NAME
history - Manipulate the history list
SYNOPSIS
history ?option? ?arg arg ...?
_________________________________________________________________
DESCRIPTION
The history command performs one of several operations related to recently-executed commands recorded in a history list. Each of these
recorded commands is referred to as an ``event''. When specifying an event to the history command, the following forms may be used:
[1] A number: if positive, it refers to the event with that number (all events are numbered starting at 1). If the number is negative,
it selects an event relative to the current event (-1 refers to the previous event, -2 to the one before that, and so on). Event 0
refers to the current event.
[2] A string: selects the most recent event that matches the string. An event is considered to match the string either if the string
is the same as the first characters of the event, or if the string matches the event in the sense of the string match command.
The history command can take any of the following forms:
history
Same as history info, described below.
history add command ?exec?
Adds the command argument to the history list as a new event. If exec is specified (or abbreviated) then the command is also exe-
cuted and its result is returned. If exec isn't specified then an empty string is returned as result.
history change newValue ?event?
Replaces the value recorded for an event with newValue. Event specifies the event to replace, and defaults to the current event
(not event -1). This command is intended for use in commands that implement new forms of history substitution and wish to replace
the current event (which invokes the substitution) with the command created through substitution. The return value is an empty
string.
history clear
Erase the history list. The current keep limit is retained. The history event numbers are reset.
history event ?event?
Returns the value of the event given by event. Event defaults to -1.
history info ?count?
Returns a formatted string (intended for humans to read) giving the event number and contents for each of the events in the history
list except the current event. If count is specified then only the most recent count events are returned.
history keep ?count?
This command may be used to change the size of the history list to count events. Initially, 20 events are retained in the history
list. If count is not specified, the current keep limit is returned.
history nextid
Returns the number of the next event to be recorded in the history list. It is useful for things like printing the event number in
command-line prompts.
history redo ?event?
Re-executes the command indicated by event and returns its result. Event defaults to -1. This command results in history revision:
see below for details.
HISTORY REVISION
Pre-8.0 Tcl had a complex history revision mechanism. The current mechanism is more limited, and the old history operations substitute and
words have been removed. (As a consolation, the clear operation was added.)
The history option redo results in much simpler ``history revision''. When this option is invoked then the most recent event is modified
to eliminate the history command and replace it with the result of the history command. If you want to redo an event without modifying
history, then use the event operation to retrieve some event, and the add operation to add it to history and execute it.
KEYWORDS
event, history, record
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tcl history(1T)