1

I need to run a command ls and cal in single line

But i need to write it without using & and ; symbols...

Is there any way to write it?

4
  • 4
    Why? This sounds like homework, or is it just a random puzzle you came up with? Obviously your ampersand and semicolon keys haven't been stolen since you could write them in the question text ... Commented Aug 16, 2013 at 12:04
  • 1
    What exactly is the context of the problem? Why do you want to do this this way? Commented Aug 16, 2013 at 12:07
  • No i was playing a small web challenges. And i got struck in this point ... they blocked both symbols in it and there might be any way to solve it seems... just to know weather we have any alternatives to it... Commented Aug 16, 2013 at 12:08
  • 1
    Not particularly useful, but ! cal || ls comes to mind... Commented Sep 10, 2013 at 20:26

2 Answers 2

2

You could use backticks and echo

echo `ls` "`cal`"

The double quotes keep echo from destroying the whitespace in cals output.

Sign up to request clarification or add additional context in comments.

2 Comments

passthru("grep -i $our_value contents.txt"); we need pass our input in our value place and need to execute multiple commands
What is "passthru"? And please ask the question you want answered, to begin with.
0

I guess | will help you. To read the listing of a directory with many files, page-by-page, I did ls | more

2 Comments

preg_match('/[;|&]/',Sinput) Is there any other way without | symbol... Still it not works
@ViVek , Try looking here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.