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;








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 input


  • Desired 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









share|improve this question






























    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 input


    • Desired 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









    share|improve this question


























      0












      0








      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 input


      • Desired 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









      share|improve this question
















      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 input


      • Desired 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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      mosvy

      9,0571833




      9,0571833










      asked 2 days ago









      NayakNayak

      286




      286




















          1 Answer
          1






          active

          oldest

          votes


















          2














          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 a except
          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.






          share|improve this answer

























          • 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











          • klassik....works well too... :) Thank you very much for quick & correct support.

            – Nayak
            2 days ago











          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
          );



          );













          draft saved

          draft discarded


















          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









          2














          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 a except
          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.






          share|improve this answer

























          • 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











          • klassik....works well too... :) Thank you very much for quick & correct support.

            – Nayak
            2 days ago















          2














          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 a except
          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.






          share|improve this answer

























          • 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











          • klassik....works well too... :) Thank you very much for quick & correct support.

            – Nayak
            2 days ago













          2












          2








          2







          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 a except
          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.






          share|improve this answer















          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 a except
          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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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 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

















          • 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











          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

          Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

          NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided