Results 1 to 2 of 2
At the moment, I'm playing with a script. It goes like this:
Code:
sudo su
echo "meow"
It's that simple. The script is called "kitty." I have it on the ...
- 07-14-2007 #1
sudo su problem
At the moment, I'm playing with a script. It goes like this:
Code:sudo su echo "meow"
It's that simple. The script is called "kitty." I have it on the desktop.
Anyway, when I go into terminal, I do the following.
It goes into root, but it doesn't echo.Code:cd ./Desktop/ bash kitty
Why does it not echo?
I eventually want to use scripts like this in a more advanced way. However, at the moment, I'm just trying to access root with a script. Afterwards, I want the script to continue.
Why does the script not continue after going into root?
- 07-14-2007 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
This won't work because su is running as a seperate terminal. The echo command will run when you terminate the 'su' with ctrl+d. Why don't you have a shabang in your script?
The correct way to do it is to write the script you want and then run that script as root or using sudo.Code:#!/bin/bash


Reply With Quote