Skip to main content
19 events
when toggle format what by license comment
Apr 13, 2017 at 12:36 history edited CommunityBot
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Oct 8, 2013 at 14:12 comment added Rahul Patil then in same script use send useradd testuser2
Oct 8, 2013 at 14:10 comment added Rahul Patil Mysu.sh should contains only /usr/bin/su -
Oct 8, 2013 at 13:37 comment added atp9 I have added that to question. as image
Oct 8, 2013 at 12:43 comment added Rahul Patil show the code,talk is less
Oct 8, 2013 at 12:03 comment added atp9 earlier I used to get spawn not found error but now something new came up. it shows line of code and nothing happens. I have root password using which I am creating the new account but no luck in that.
Oct 8, 2013 at 11:45 comment added atp9 I have added a screen shot with question. Please let me know what is wrong here. Well i couldn't find any other place to add it so thought to add that in question itself
Oct 8, 2013 at 7:28 comment added Rahul Patil can you please show me screen shot of that error, if possible show me your script also
Oct 8, 2013 at 6:05 comment added atp9 Thanks for that link Rahul. That works if i have spawn command. I need to run that on AIX and it gives me an error "spawn not found".
Oct 7, 2013 at 12:06 comment added Rahul Patil paste.ubuntu.com/6204664
Oct 7, 2013 at 8:38 comment added atp9 My understanding on this command is that when it hits su command (it may get in waiting status) and expect command reads Password from su prompt and it will send my password (xyz) to the prompt. here the problem is i am getting error:invalid command name "su" while executing "su" (file "testSample1.sh" line 2)
Oct 7, 2013 at 8:36 comment added atp9 I tried expect command but it is not helping me to understand how it will work. what i am trying is as below: #!/usr/bin/expect su expect "Password:" send "xyz"
Oct 3, 2013 at 13:53 comment added atp9 Thanks for suggesting vladz.devzero.fr/002_su-stdin.php I can try something like that.
Oct 1, 2013 at 14:21 comment added Rahul Patil also check some su trick in this link vladz.devzero.fr/002_su-stdin.php
Oct 1, 2013 at 14:06 comment added Rahul Patil have take look at expect tool nist.gov/el/msid/expect.cfm
Oct 1, 2013 at 13:54 comment added atp9 Any idea how can I do the same thing for su command. Assume I have a root password and i want to change to root mode without giving any prompt so that i can run/invoke scripts from remote server using java or .net
Sep 26, 2013 at 5:42 vote accept atp9
Sep 25, 2013 at 14:47 comment added Rahul Patil @tbp_09 can you please accept ans as correct :)
Sep 9, 2013 at 14:48 history answered Rahul Patil CC BY-SA 3.0