LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-05-2006, 08:49 AM   #1
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
Bash Scripting questions (2)


Hi all!

I have 2 pretty simple questions, (I think)

1. How do I pipe the output to the end of a file without erasing the front?

ie (cat x >something.txt) always erases what was in there.

2. How do I give someone root access to a command that requires root access?

I would like to make a script to let some run ping tests, it requires root though. Do I need to make them a /usr/bin directory and chown it to them, or is it better to change permissions on ping and let them run a ping script?

Thanks!
 
Old 04-05-2006, 08:58 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
  1. Code:
    $cat something >> outputfile
  2. look into the sudo command
I am not entirely sure how to give people root access in shell scripts without modifying the permissions of the commands.

Last edited by reddazz; 04-05-2006 at 09:01 AM.
 
Old 04-05-2006, 09:27 AM   #3
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
Thanks!

I know there are ways to do number 2, I trying to find the easiest/best way..I think i can move the bin or use the ln command to make links, not sure what is the norm though.
 
Old 04-05-2006, 12:14 PM   #4
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Quote:
Originally Posted by rjcrews
Thanks!

I know there are ways to do number 2, I trying to find the easiest/best way..I think i can move the bin or use the ln command to make links, not sure what is the norm though.
The norm is to use sudo, like reddazz already said. As far as I know, you don't need to change the access rights of the binary.
 
  


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
Bash scripting questions stryka Programming 3 11-24-2005 11:46 PM
bash scripting questions nix101 Linux - Newbie 2 09-04-2005 09:26 AM
help on bash scripting Kendo1979 Linux - Newbie 3 05-17-2005 07:10 PM
Bash scripting questions irfanhab Programming 2 06-07-2004 12:13 PM
BASH scripting help Chucklez Linux - Newbie 4 12-12-2002 12:07 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration