error while using sed in tcsh aliasHow do I temporarily bypass an alias in tcsh?tcsh alias - find FreeBSD portHow to print a partial list of alias definitions in tcsh?tcsh: sequence commandtcsh alias for cd through path of a port after searchingls after cd in tcsh?deleting alias from file using sedsed inside tcsh foreach looptcsh alias with complex cmds, quotes and cmd argumentsProcess continues to run after receiving uncaught SIGINT (Ctrl-C from terminal)
Alternative to sending password over mail?
Today is the Center
Why is consensus so controversial in Britain?
Why doesn't H₄O²⁺ exist?
High voltage LED indicator 40-1000 VDC without additional power supply
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
A case of the sniffles
Are the number of citations and number of published articles the most important criteria for a tenure promotion?
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
NMaximize is not converging to a solution
Theorems that impeded progress
How to format long polynomial?
How much RAM could one put in a typical 80386 setup?
If human space travel is limited by the G force vulnerability, is there a way to counter G forces?
Is it inappropriate for a student to attend their mentor's dissertation defense?
What are these boxed doors outside store fronts in New York?
Can I ask the recruiters in my resume to put the reason why I am rejected?
RSA: Danger of using p to create q
Is it possible to run Internet Explorer on OS X El Capitan?
Has there ever been an airliner design involving reducing generator load by installing solar panels?
Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)
LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function
Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?
tikz convert color string to hex value
error while using sed in tcsh alias
How do I temporarily bypass an alias in tcsh?tcsh alias - find FreeBSD portHow to print a partial list of alias definitions in tcsh?tcsh: sequence commandtcsh alias for cd through path of a port after searchingls after cd in tcsh?deleting alias from file using sedsed inside tcsh foreach looptcsh alias with complex cmds, quotes and cmd argumentsProcess continues to run after receiving uncaught SIGINT (Ctrl-C from terminal)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am unable to "source/run" my tcsh
alias, which is as below:
alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'"
where
!:1
= Manual inputDesired Output =
/scr/cb2TempProd/tmp/$USER/test/Simulation/Input/X1_X_XXXX_XXXXXX15X_H10EK011.inp
I will use additional alias (predefined) on Desired Output =
alias inp2 "gdyn `grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'`"
- first issue = solving non-compatible variable error (while sourcing alias file)
- second issue = can i have both outputs in single alias
linux alias tcsh
add a comment |
I am unable to "source/run" my tcsh
alias, which is as below:
alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'"
where
!:1
= Manual inputDesired Output =
/scr/cb2TempProd/tmp/$USER/test/Simulation/Input/X1_X_XXXX_XXXXXX15X_H10EK011.inp
I will use additional alias (predefined) on Desired Output =
alias inp2 "gdyn `grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'`"
- first issue = solving non-compatible variable error (while sourcing alias file)
- second issue = can i have both outputs in single alias
linux alias tcsh
add a comment |
I am unable to "source/run" my tcsh
alias, which is as below:
alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'"
where
!:1
= Manual inputDesired Output =
/scr/cb2TempProd/tmp/$USER/test/Simulation/Input/X1_X_XXXX_XXXXXX15X_H10EK011.inp
I will use additional alias (predefined) on Desired Output =
alias inp2 "gdyn `grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'`"
- first issue = solving non-compatible variable error (while sourcing alias file)
- second issue = can i have both outputs in single alias
linux alias tcsh
I am unable to "source/run" my tcsh
alias, which is as below:
alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'"
where
!:1
= Manual inputDesired Output =
/scr/cb2TempProd/tmp/$USER/test/Simulation/Input/X1_X_XXXX_XXXXXX15X_H10EK011.inp
I will use additional alias (predefined) on Desired Output =
alias inp2 "gdyn `grep -i "final_model" /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'`"
- first issue = solving non-compatible variable error (while sourcing alias file)
- second issue = can i have both outputs in single alias
linux alias tcsh
linux alias tcsh
edited 2 days ago
mosvy
9,0571833
9,0571833
asked 2 days ago
NayakNayak
286
286
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In csh
, the variable substitution always occurs within double quotes, and cannot be prevented by a backslash:
% echo "$"
Illegal variable name.
% echo "$"
Variable name must contain alphanumeric characters.
% echo "\$"
Variable name must contain alphanumeric characters.
% echo $
$
This is different from the bourne shell and is documented in the manpage[1]:
After the input line is aliased and parsed, and before each command is
executed, variable substitution is performed, keyed by$
characters.
This expansion can be prevented by preceding the$
with aexcept
within double quotes ("
), where it always occurs, and within single
quotes ('
), where it never occurs. Strings quoted by backticks (` `
)
are interpreted later (see Command substitution below), so$
substitution does not occur there until later, if at all. A$
is passed
unchanged if followed by a blank, tab, or end-of-line.
The easiest way out for your alias may be to start/stop the double quoting before/after the $
:
alias inp1 "grep -i 'final_model' /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>"$"//'"
For your second alias, I think you should simply reuse inp1
instead of trying to paste it in:
alias inp2 'gdyn `inp1 !:1`'
[1] that's the manpage of csh
, but the quotings & substitutions are absolutely similar in tcsh
.
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean bothinp1
andinp2
? maybealias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510248%2ferror-while-using-sed-in-tcsh-alias%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In csh
, the variable substitution always occurs within double quotes, and cannot be prevented by a backslash:
% echo "$"
Illegal variable name.
% echo "$"
Variable name must contain alphanumeric characters.
% echo "\$"
Variable name must contain alphanumeric characters.
% echo $
$
This is different from the bourne shell and is documented in the manpage[1]:
After the input line is aliased and parsed, and before each command is
executed, variable substitution is performed, keyed by$
characters.
This expansion can be prevented by preceding the$
with aexcept
within double quotes ("
), where it always occurs, and within single
quotes ('
), where it never occurs. Strings quoted by backticks (` `
)
are interpreted later (see Command substitution below), so$
substitution does not occur there until later, if at all. A$
is passed
unchanged if followed by a blank, tab, or end-of-line.
The easiest way out for your alias may be to start/stop the double quoting before/after the $
:
alias inp1 "grep -i 'final_model' /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>"$"//'"
For your second alias, I think you should simply reuse inp1
instead of trying to paste it in:
alias inp2 'gdyn `inp1 !:1`'
[1] that's the manpage of csh
, but the quotings & substitutions are absolutely similar in tcsh
.
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean bothinp1
andinp2
? maybealias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
add a comment |
In csh
, the variable substitution always occurs within double quotes, and cannot be prevented by a backslash:
% echo "$"
Illegal variable name.
% echo "$"
Variable name must contain alphanumeric characters.
% echo "\$"
Variable name must contain alphanumeric characters.
% echo $
$
This is different from the bourne shell and is documented in the manpage[1]:
After the input line is aliased and parsed, and before each command is
executed, variable substitution is performed, keyed by$
characters.
This expansion can be prevented by preceding the$
with aexcept
within double quotes ("
), where it always occurs, and within single
quotes ('
), where it never occurs. Strings quoted by backticks (` `
)
are interpreted later (see Command substitution below), so$
substitution does not occur there until later, if at all. A$
is passed
unchanged if followed by a blank, tab, or end-of-line.
The easiest way out for your alias may be to start/stop the double quoting before/after the $
:
alias inp1 "grep -i 'final_model' /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>"$"//'"
For your second alias, I think you should simply reuse inp1
instead of trying to paste it in:
alias inp2 'gdyn `inp1 !:1`'
[1] that's the manpage of csh
, but the quotings & substitutions are absolutely similar in tcsh
.
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean bothinp1
andinp2
? maybealias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
add a comment |
In csh
, the variable substitution always occurs within double quotes, and cannot be prevented by a backslash:
% echo "$"
Illegal variable name.
% echo "$"
Variable name must contain alphanumeric characters.
% echo "\$"
Variable name must contain alphanumeric characters.
% echo $
$
This is different from the bourne shell and is documented in the manpage[1]:
After the input line is aliased and parsed, and before each command is
executed, variable substitution is performed, keyed by$
characters.
This expansion can be prevented by preceding the$
with aexcept
within double quotes ("
), where it always occurs, and within single
quotes ('
), where it never occurs. Strings quoted by backticks (` `
)
are interpreted later (see Command substitution below), so$
substitution does not occur there until later, if at all. A$
is passed
unchanged if followed by a blank, tab, or end-of-line.
The easiest way out for your alias may be to start/stop the double quoting before/after the $
:
alias inp1 "grep -i 'final_model' /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>"$"//'"
For your second alias, I think you should simply reuse inp1
instead of trying to paste it in:
alias inp2 'gdyn `inp1 !:1`'
[1] that's the manpage of csh
, but the quotings & substitutions are absolutely similar in tcsh
.
In csh
, the variable substitution always occurs within double quotes, and cannot be prevented by a backslash:
% echo "$"
Illegal variable name.
% echo "$"
Variable name must contain alphanumeric characters.
% echo "\$"
Variable name must contain alphanumeric characters.
% echo $
$
This is different from the bourne shell and is documented in the manpage[1]:
After the input line is aliased and parsed, and before each command is
executed, variable substitution is performed, keyed by$
characters.
This expansion can be prevented by preceding the$
with aexcept
within double quotes ("
), where it always occurs, and within single
quotes ('
), where it never occurs. Strings quoted by backticks (` `
)
are interpreted later (see Command substitution below), so$
substitution does not occur there until later, if at all. A$
is passed
unchanged if followed by a blank, tab, or end-of-line.
The easiest way out for your alias may be to start/stop the double quoting before/after the $
:
alias inp1 "grep -i 'final_model' /scr/cb2TempProd/tmp/$USER/!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>"$"//'"
For your second alias, I think you should simply reuse inp1
instead of trying to paste it in:
alias inp2 'gdyn `inp1 !:1`'
[1] that's the manpage of csh
, but the quotings & substitutions are absolutely similar in tcsh
.
edited 2 days ago
answered 2 days ago
mosvymosvy
9,0571833
9,0571833
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean bothinp1
andinp2
? maybealias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
add a comment |
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean bothinp1
andinp2
? maybealias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
I did. works well. is it possible to have both outputs in one alias ?
– Nayak
2 days ago
you mean both
inp1
and inp2
? maybe alias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
you mean both
inp1
and inp2
? maybe alias inp3 'set v = `inp1 !:1`; echo "$v"; gdyn "$v"'
– mosvy
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
klassik....works well too... :) Thank you very much for quick & correct support.
– Nayak
2 days ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510248%2ferror-while-using-sed-in-tcsh-alias%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown