0
cdm="home/nmsadm/tngVersion/iconTestNetworkGenerator.sh -input /home/nmsadm/ipr/ipr_files/IP_1.xml -templateDir /home/nmsadm/Try_K/1 -nocs -erbsstart 1 -subnetwork 25 -iprstart 11"

#above statment is in a single line

$cdm

I stored one command in a variable called cdm, now I want to run this command so I used $cdm. But I'm getting an error

home/nmsadm/tngVersion/iconTestNetworkGenerator.sh: No such file or directory

I'm pretty sure that there is file in that specified directory.

How should I fix this?

3
  • 4
    Would you at least take a bit of time to format your question and spell words in full (other people already improved your question, so please remember how it should look for next time)? When you don't even care to write properly, why do you expect people to care to solve your problem? Commented Aug 1, 2013 at 9:05
  • Also, use arrays, instead of single string containing command+parameters... Commented Aug 1, 2013 at 12:05
  • @anishsane : could you plz tell me how to use the arrays, with example Commented Aug 8, 2013 at 10:28

2 Answers 2

5

It is apparently trying to execute the command. The error quotes the command name from the variable. But the command is wrong. Did you by any chance forget initial /?

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

1 Comment

Yes, u r correct , thankx :) cdm="/home/nmsadm/tngVersion/iconTestNetworkGenerator.sh -input /home/nmsadm/ipr/ipr_files/IP_1.xml -templateDir /home/nmsadm/Try_K/1 -nocs -erbsstart 1 -subnetwork 25 -iprstart 11"
2

Since you specified the name of a command along with a directory the command is supposed to be in, there is no PATH lookup performed. Apparently you are not in a directory where the pathname

  home/nmsadm/tngVersion/iconTestNetworkGenerator.sh

refers to an existing file. Fix this either by using an absolute path, probably

  /home/nmsadm/tngVersion/iconTestNetworkGenerator.sh

or by cd'ing to the proper directory first, probably

  cd /
  $cmd

Comments

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.