0

lets say I have 2 aliases, each having multiple arguments. It looks somewhat like below example

alias s1 "command1 -a -b -c"
alias s2 "command2 -d -e -f"

now if I run :s1 s2 in terminal, it cant recognize s2. I found that in bash we can add a space after s2 and it works. Neither that is working in csh, nor it supports function().

Is there any way ?

PS: I actually have various flavors of s1 which I need to combine with flavors of s2.

2
  • I don't understand exactly what you're trying to do. Can you provide more practical example? how should those two commands run together, what is the expected result? Both s1 and s2 are expanded only in command context. They are not variables. If you run s1 s2, in your example, the result would be: command1 -a -b -c s2, because s1 is expanded (since it's the first word in the line) but s2 is not treated as a command or an alias, it's treated as an argument to s1. So I don't understand what exactly you're trying to achieve here.
    – aviro
    Commented May 9, 2022 at 9:26
  • @aviro hi, s2 does get expanded in bash , if we keep an extra space at the end of the alias statement in RHS. On the practical example side, s1 is actually lsf job launch prefix and s2 is the actual command I am trying to launch in lsf. Commented May 9, 2022 at 11:44

0

You must log in to answer this question.

Browse other questions tagged .