Hi all,
As i want to know how the shell command "nohup" worked.I logged in as the user named vincent through Gnome.Then i press ctrl+atl+F1 changed into a console and logged in as another user named kinsley.The user "kinsley" is added by me with "useradd",and now there's no HOME directory for him(why?),and i have no right to make a new file.I moved a script which is owned by vincent to the directory of kinsley,and changed the file mode and ownership like this:
and the file mode,ownership of /home/kinsley is
The problem is i was NOT able to execute this script as kinsley.
The context of that script is:
why can't i execute this script?
You logged in as someone who had no home directory, and despite not being able to create a file, you copied a file called "script" into that directory?
So you copied a file, something you are unable to do, to somewhere that didn't exist?
What error did you get (aside from the invalid . in the while loop - that you wouldn't see, as you couldn't execute the script!)? Which OS are you using?
I created the directory /home/kinsley for kinsley before i copied the script into that directory.I didn't not get any output and error code while i executing that script,it looked like an endless loops without any output.The dot after while means TRUE In bash shell,isn't it?I use ubuntu 10.10 2.6.35-22-generic
A : would mean "true". I tested a . in bash (not in Ubuntu) and it throws an error.
If your user was missing a home directory, you probably just forgot to specify it when running useradd.
You obviously resolved that using mkdir, chown and chmod.
I'm confused (it doesn't always take much to confuse me!), but where exactly is your problem, and what has nohup to do with it? (except that if you had run it nohup, the output would go to nohup.out by default)
You said you couldn't execute the script, but clearly you can if it's an infinite loop.
Try changing the . to a :. Otherwise perhaps you have an alias for date that's expecting some input (that would make the script seem "infinite")?
You logged in as someone who had no home directory, and despite not being able to create a file, you copied a file called "script" into that directory?
So you copied a file, something you are unable to do, to somewhere that didn't exist?
What error did you get (aside from the invalid . in the while loop - that you wouldn't see, as you couldn't execute the script!)? Which OS are you using?
sorry i make a fool mistake....In my script,the sleep time was set to be very long as a careless mistake.So i thought it wasn't executed.... what a fool i am.....Anyway,thanks for your help
---------- Post updated at 10:21 AM ---------- Previous update was at 10:17 AM ----------
Quote:
Originally Posted by scottn
A : would mean "true". I tested a . in bash (not in Ubuntu) and it throws an error.
If your user was missing a home directory, you probably just forgot to specify it when running useradd.
You obviously resolved that using mkdir, chown and chmod.
I'm confused (it doesn't always take much to confuse me!), but where exactly is your problem, and what has nohup to do with it? (except that if you had run it nohup, the output would go to nohup.out by default)
You said you couldn't execute the script, but clearly you can if it's an infinite loop.
Try changing the . to a :. Otherwise perhaps you have an alias for date that's expecting some input (that would make the script seem "infinite")?
Thanks,all your words here are right except about ".".Now i realized the : means true,however,my code runs well when i still use "." as a test
Hi team,
My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server.
I have completed the first part i.e From windows to using to unix server with the help of psftp.exe
code:
psftp user@host -pw password <... (1 Reply)
I have a master shell script master.sh which will invoke 2 shell scripts (test1.sh,test2.sh). Both of these shell scripts will
execute stored procedure. I will invoke test1.sh, test2.sh respectively. Now both of these scripts are executing parallel.
But i want to invoke the 2nd script(test2.sh)... (3 Replies)
Hi Experts,
I want to execute shell script(on HP-UX) wihout specifying interpreter.
For e.g generally we use following command to execute shell
sh test.sh
but I want to execute it as
test.sh
currently if I execute directly it as test.sh it is giving error Commnd Not... (7 Replies)
Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh.
Thanks in advance (2 Replies)
i want use ssh on the host01 to execute autoexec.sh on the host02 like following :
host01> ssh host02 autoexec.sh
autoexec.sh include nohup command like follwing :
nohup /home/jack/deletedata.sh &
after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Hi all,
I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script?
Thanks
i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Hi ,
I have 4 shell scripts
a.ksh
b.ksh -> depends on a.ksh success -> log into b.log
c.ksh -> depends on b.ksh success -> log into c.log
d.ksh -> depends on c.ksh success -> log into d.log
I will have to write main.ksh
(
execute a.ksh , log into a.log
if a.ksh= success, execute... (1 Reply)
Hi all,
I am begginer of UNIX . I dont know if i have a script written in korn shell with .ksh extention . If i want to execute that how can i do that? Can anybody suggest the best book to learn korn shell scripting.
Thanks
sam71 (1 Reply)
I am new to UNIX , Can any one let me know how to execute shell script (i.e which command I have to use for the same).
Any help would be appreciated.
Thanks
siva
mymvs999@yahoo.com (3 Replies)