Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6324039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:37:58+00:00 2026-05-24T16:37:58+00:00

$ date > ‘< abcd’ $ cat ‘< abcd’ <something> $ tclsh8.5 % exec

  • 0
$ date > '< abcd'
$ cat '< abcd'
<something>
$ tclsh8.5
% exec cat {< abcd}
couldn't read file " abcd": no such file or directory

whoops. This is due to the the specification of ‘exec’.

If an arg (or pair of args) has one of the forms described below then it is used by exec to control the flow of input and output among the subprocess(es). Such arguments will not be passed to the subprocess(es). In forms such as “< fileName”, fileName may either be in a separate argument from “<” or in the same argument with no intervening space”.

Is there a way to work around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:37:59+00:00Added an answer on May 24, 2026 at 4:37 pm

    Does the value have to be passed as an argument? If not, you can use something like this:

    set strToPass "< foo"
    exec someProgram << $strToPass
    

    For filenames, you can (almost always) pass the fully qualified name instead. The fully qualified name can be obtained with file normalize:

    exec someProgram [file normalize "< foo"]       ;# Odd filename!
    

    But if you need to pass in an argument where < (or >) is the first character, you’re stuck. The exec command always consumes such arguments as redirections; unlike with the Unix shell, you can’t just use quoting to work around it.

    But you can use a helper program. Thus, on Unix you can do this:

    exec /bin/sh -c "exec someProgram \"$strToPass\""
    

    (The subprogram just replaces itself with what you want to run passing in the argument you really wanted. You might need to use string map or regsub to put backslashes in front of problematic metacharacters.)

    On Windows, you have to write a batch file and run that, which has a lot of caveats and nasty side issues, especially for GUI applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

date('H-m-s') gives something like this when I echo variable > 08-07-16 I have table
new Date(05-MAY-09 03.55.50) is any thing wrong with this ? i am getting illegalArgumentException
echo date(W,strtotime('2010-01-01')); This outputs 53. I would expect it to output 1. Can anyone
Date ranges including BC dates is this possible? I would like to return facets
the date is like this :12/07/2009 7:30:45 PM now i need to format the
When I use this date formatter, it's not giving me back the same date
default date format in DatePicker is yyyy-mm-dd but i need dd-mm-yyyy. This one solution
Array: ['Date Taken', 'Weight'], I have this Array and the way I am iterating
date(m); returns the following result for this month... 02 That is fine and dandy,
alert(Date.parse('Mar 1 1990')); in jsFiddle, this returns a datetime integer, as expected. On my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.