LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-09-2013, 04:40 PM   #1
mythcat
Member
 
Registered: Dec 2007
Location: Fălticeni, Romania
Distribution: Debian;Fedora
Posts: 76

Rep: Reputation: 15
execute bash script with new terminal without give the password ...


I try to execute this script:
Code:
#!/bin/sh
lxterm -e "watch -d ifconfig eth0"
1.The problem when start the new lxterm this need the su password.

I try with visudo to edit :

Code:
ALL=(usertest) NOPASSWD: /home/usertest/watch_ifconf.sh
result is :
Code:
sh: 1: ifconfig: not found
2.I want to use many terminals in same desktop and need to see all.
How can I do ?
Thank's . Regards.
 
Old 07-09-2013, 05:51 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
The full path to ifconfig should help you out
Code:
lxterm -e "watch -d /sbin/ifconfig eth0"
And you shouldn't need root to execute that. You would only require root if you wanted to change something like the IP/Netmask or State ( UP/DOWN )

Rather than starting multiple terminals and arranging, something I use which may or may not suit your needs is Terminator

With a little work you can setup profiles. Allowing the start of multiple terminal sessions each automatically executing commands/scripts all in one Window with multiple panes.
 
  


Reply

Tags
bash scripting, ifconfig


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
How to execute bash script in C waqasdaar Programming 15 10-27-2015 02:54 PM
[SOLVED] Crontab is giving different result when execute the script on terminal Srinivas Gadi Linux - Newbie 3 12-28-2012 01:51 PM
Can't execute Bash script. zbe Linux - Software 4 10-17-2008 08:05 AM
how to give password in shell script after scp kushkothari Linux - Networking 2 10-14-2008 12:13 AM
gnome-terminal fails to give bash prompt wfhoney Red Hat 8 04-21-2004 03:38 PM


All times are GMT -5. The time now is 12:01 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