LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2011, 02:56 PM   #1
marcos90
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
urgent help ...!plz


Hello every one....
I am newbie with lunix...I use fedora 10 for my studyon adhoc system
I write this shell script (in sh) extension...To make and execute a tcl script I wrote before for my project...but I still get” permission denied “ to my tcl script and I do not know what I shall do to achieve access to my tcl script..here is my the shell of sh script :

#! /bin/sh
function rout {
.
.
return
}
q=10

for (( i=0; i<$q; i++))
do
rnarry[$i]=$RANDOM
echo ${rnarry[$i]}
done

for (( i=0; i<$q; i++))
do
/home/marcos/ns-allinone-2.28/test/aodv_5routes.tcl 1Mb /home/marcoss/test ${rnarry[$i]} aodvdsr > /dev/null
rout
done

for (( i=0; i<$q; i++))
do
/home/marcos/ns-allinone-2.28/test/aodv_5routes.tcl 3Mb /home/marcoss/test ${rnarry[$i]} aodv> /dev/null
rout
done

for (( i=0; i<$q; i++))
do
/home/marcos/ns-allinone-2.28/test/aodv_5routes.tcl 10Mb /home/marcoss/test ${rnarry[$i]} ${rnarry[$i]} dsr> /dev/null
rout
done

and i get "
bsh:/home/marcos/ns-allinone-2.28/test/aodv_5routes.tcl ..permission denied
 
Old 03-10-2011, 03:01 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Welcome to LQ

Did you make
Code:
aodv_5routes.tcl
executable?
Code:
chmod +x aodv_5routes.tcl
Kind regards
 
Old 03-10-2011, 03:57 PM   #3
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
Make sure you are not accessing the tcl script from someone else's home directory unless you are logged in as the super user / root.

Also check that your shell script and aodv_5routes.tcl are in your own home directory. That is not necessary if you login as the super user / root and place your tcl script in /bin or /usr/bin with sufficient permissions set on it.

Try these things:

chmod 755 aodv_5routes.tcl

or

chmod +x aodv_5routes.tcl


Try copying / moving the tcl script in /usr/bin or /bin, if you are still unable to execute the tcl script.
 
Old 03-10-2011, 05:07 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
Quote:
I am newbie with lunix...I use fedora 10 for my studyon adhoc system
Youdo know that fedora 10 is a dead and unsupported version of fedora.It is 4 versions out of date. Has NOT had any updates in over a year . Hit it's END OF LIFE last year -- DEAD .

if you are going to use fedora then YOU NEED to stay current
fedora 14 it the current
 
Old 03-10-2011, 05:24 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Quote:
/home/marcos/ns-allinone-2.28/test/aodv_5routes.tcl
Not quite clear what you are doing. Or what you want to do with the shell script.

All tcl scripts must be run by an interpreter. ( E.g. wish file.tcl ).
In ns2 it is : 'ns file.tcl'.
So unless you in some way incorporate the ns command into your tcl script,
it doesn't look like something, that's usable.

A tcl script can be made executable, when line 1 says : #!/usr/bin/wish.
May be it's possible to use the ns command in that way too ? ?

..
 
Old 03-10-2011, 06:07 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
--- deleted ---
jlinkels

Last edited by jlinkels; 03-10-2011 at 09:43 PM.
 
Old 03-10-2011, 06:30 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
# 6 : There are about 400 files.tcl in ns-2.xx, a handful (5 ?) uses tclsh.

The binary 'ns' includes and understands some special commands
and is used as the main interpreter.

..

Last edited by knudfl; 03-10-2011 at 06:31 PM.
 
Old 03-10-2011, 09:44 PM   #8
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
#7: I see. Deleted my useless post.

jlinkels
 
Old 03-10-2011, 10:01 PM   #9
marcos90
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
help ....

Quote:
Originally Posted by knudfl View Post
Not quite clear what you are doing. Or what you want to do with the shell script.

All tcl scripts must be run by an interpreter. ( E.g. wish file.tcl ).
In ns2 it is : 'ns file.tcl'.
So unless you in some way incorporate the ns command into your tcl script,
it doesn't look like something, that's usable.

A tcl script can be made executable, when line 1 says : #!/usr/bin/wish.
May be it's possible to use the ns command in that way too ? ?

..
hello everyone
thank you all for your time and effort i tried to use chmod but it did not work....

also i have tried to use friend " knudfl" method ..it accept the permission to access " i think " ...but i got another error:
error in startup script:invaild command name "function" while executing function rout () {so may i kindly ask for your help ....

dear all friends ...what i am trying to do is to let my shell do some itrarations on "aodv_5routes.tcl" and collect the information i want to collect by function "rout" that i have aleardy wrote .
theses "3Mb /home/marcoss/test ${rnarry[$i]} aodv> /dev/null" are my input arrguments to my tcl script..

"
 
Old 03-11-2011, 12:07 AM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
---edit --

Last edited by John VV; 03-11-2011 at 01:57 AM.
 
Old 03-11-2011, 02:24 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Post # 6 (#8), @jinkels
Quote:
--- deleted ---
jlinkels
Actually the text was very informative : General knowledge about tcl.
'tclsh' is being used, in the background, for some tcl files, that are
dependencies for the file.tcl run with ns.


Post # 9, @marcos90 : The purpose of the 'shell script' is not clear.
May be you are doing commands, that won't work ? (E.g. ref. post #10, @John_VV)

Will your tcl script work with a stand alone command? (And which command? )
Suggest: Attach the "file.tcl", or upload it to a pastebin site.


Some shell scripts are used in ns2. Please read the (14) <files>.sh in
ns-allinone-2.28/ns-2.28/tcl/ex/red-pd/ ( The scripts use csh ).
I'd guess, there are better examples. But I have only tried running those,
and they seem to do complex stuff. (The "runall.sh" sequence runs for 4+ hours.)

..
 
Old 03-11-2011, 05:12 AM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
i deleted that , for the reason i am unsure about that /dev/null
sending a 1,3 meg fle made with null or just outputing to null
it looks like the output is > is directed to dev/null
 
Old 08-12-2011, 02:03 PM   #13
umair ahmed
LQ Newbie
 
Registered: Jul 2011
Location: karachi,pakistan
Distribution: ubuntu
Posts: 13

Rep: Reputation: Disabled
Hi
I am using the following shell script using the setdest utility in ns2 to generate multiple scenarios but the script is not working ,can anybody help me with this ,it's urgent ,I've posted this many places but no help has been there.please help me with this script
Code:
#!/bin/bash

dest_dir="movement"

if [ -d $dest_dir ]
then
      # Do nothing
      echo "'$dest_dir' is a directory"
else
      echo "Creating directory $dest_dir";
      mkdir --verbose $dest_dir
fi

setdest_loc="/home1/ns/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest/setdest";

if [ -x $setdest_loc ]
then
      # Do nothing
      echo "$setdest_loc is executable"
else
      echo "$setdest_loc does not exist or is not executable";
      exit;
fi

# Create the scenarios

for i in 0 10 20 40 100
do
      $setdest_loc -v 1 -n 25 -p $i -M 20 -t 100 -x 500 -y 500 > $dest_dir/scen-25-$i
done

echo ""
echo "Created the following files"
echo ""
ls -la $dest_dir/scen-25*
it just echoes the if condition setdest is not executable
we use setdest in this way
./setdest in the directory of setdest ,so why this is not working how can I write ./setdest in this shell script .?
I am working on ubuntu 10.10.

Last edited by umair ahmed; 08-13-2011 at 06:40 AM.
 
Old 08-12-2011, 05:05 PM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by umair ahmed View Post
Hi
I am using the following shell script using the setdest utility in ns2 to generate multiple scenarios but the script is not working ,can anybody help me with this ,it's urgent ,I've posted this many places but no help has been there.please help me with this script

it just echoes the if condition setdest is not executable we use setdest in this way
./setdest in the directory of setdest ,so why this is not working how can I write ./setdest in this shell script .?
I am working on ubuntu 10.10.
This is NOT urgent for anyone here, and don't hijack another persons thread with your question..open your own thread. Especially don't reopen a thread from FIVE MONTHS ago.

And we might be able to help you if you provided any details...like HOW it's not working, what message(s) you get when you run it, etc. All you've told us is you're using NS2 with a script you downloaded, and it's not working. How do you expect anyone to be able to help you when you don't provide details? And no one is going to be able to FIND your thread, since you tacked it on to someone elses.
 
Old 08-13-2011, 02:26 AM   #15
umair ahmed
LQ Newbie
 
Registered: Jul 2011
Location: karachi,pakistan
Distribution: ubuntu
Posts: 13

Rep: Reputation: Disabled
@TB0ne OK .OK ,I am new to LQ,I saw a thread that was similar to my question type so I posted it there,now you tell me to open my own thread ,so I will.Thanks .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Plz help me urgent rbala14 Linux - Newbie 2 01-25-2008 02:14 AM
help me URGENT PLZ Evelyne Programming 1 10-28-2007 01:30 PM
Urgent...plz help me!!! masudur_iiu Linux - General 6 08-17-2006 05:23 AM
Urgent!!!!plz Help jamal91 Linux - Newbie 16 07-04-2006 03:31 PM
Plz help, urgent sunil_lc Linux - Networking 4 10-28-2003 01:30 PM


All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration