tcsh: command run

tcsh: command run

Post by Ton » Mon, 25 Jan 1999 04:00:00



Hi, all:

This is my 1st time post here, so please don't flame if I've done sth wrong. And thanks for your reply!

I want to store my command in a varible and run it later with that varible. Like this:

localhost:>set v3='echo 112233'
localhost:>$v3
112233

But I want some mechanic so that I can build up the command. I still can't figure out how to do the
following:

- use history (e.g. set v3='echo \!*')
- use other varible (e.g. set v3='echo $v2')
- use delimeter like ' (e.g. set v3='awk \'{print} \' ')

The only thing I can do, (still don't know why) is:

localhost:>set v3='echo \!*'
localhost:>$v3 a b c
echo: No match.

localhost:>tcsh -v -c "$v3 a b c"
echo a b c
a b c

TIA

-- Anti-Spam: Remove triple 5 from my address before reply

 
 
 

tcsh: command run

Post by Barry Margoli » Wed, 27 Jan 1999 04:00:00




>I want to store my command in a varible and run it later with that
>varible. Like this:

>localhost:>set v3='echo 112233'
>localhost:>$v3
>112233

>But I want some mechanic so that I can build up the command. I still
>can't figure out how to do the
>following:

>- use history (e.g. set v3='echo \!*')
>- use other varible (e.g. set v3='echo $v2')
>- use delimeter like ' (e.g. set v3='awk \'{print} \' ')

>The only thing I can do, (still don't know why) is:

>localhost:>set v3='echo \!*'
>localhost:>$v3 a b c
>echo: No match.

This is trying to match the filename wildcard '!*'.  History substitution
is not done on the result of substituting a variable.  And even if it were,
!* would mean the arguments to the *previous* command; the only time that
history refers to the current command is when expanding aliases.

In fact, it sounds like you're trying to duplicate the functionality of
aliases, so why don't you just use them?

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.

 
 
 

1. How to run ".x" command from tcsh?

I have a program named ".x" in my ~/bin directory (filename is
"~/bin/.x").

When I type ".x parameters" at the prompt, tcsh's command correction
facility steps in and asks me if I really meant to type ". parameters"?
This is preposterous, because "." is a directory, why would I want to
execute it?  (I still wonder why tcsh thinks I can execute directories,
since stat(2) makes this information available, but that's beside the
point.)  Yes the ".x" file IS executable.  sh and csh have no trouble
finding and executing the program.  And yes, there is a good reason for
calling it ".x".

If I place "." in my path, and put the ".x" file in my current
directory, tcsh WILL execute the program without complaint.  Also, if I
tell tcsh "no" when it asks me for correction, then it will go on and
properly execute the command.  However, tcsh always queries me whenever
I run the command.

What can I do about this?  Is it a bug in tcsh?

"echo $version" gives:
tcsh 6.03.00 (Cornell) 92/11/20 (sun4) options 8b,nls,dl,al

--

       "Statistics show that most of the people are in the
         majority, while only a few are in the minority."

2. qpopper error

3. return status of commands run in su - <name> -c "<command>"

4. strange kernel-message

5. name of run command (which run)

6. 1.6 installation woes

7. When CGI run..How can run root permission command ?

8. Where can I get MKLinux for the MAC in one easy download?

9. Sed loops on the command line in tcsh (was: Re: How to change leading tabs?)

10. history command matching with tcsh

11. Return status of commands: tcsh

12. tcsh - command history between shells

13. TCSH command history editing