need to do ctrl+d using bash script

291 views
Skip to first unread message

vaibhav shah

unread,
Sep 5, 2013, 1:17:03 AM9/5/13
to vg...@googlegroups.com
Hi Experts,

I am running one command using bash script and command keep showing logs on terminal. To exit form logs i have to press ctrl +d. If i will not press ctrl+d, it will not execute next script command.

I mention exit command in script but it is not getting executed.

So kindly please let me know that is there any way for ctrl+d in mid of script and can be executed next command. I am trying with "screen" command also but still not getting anything.

Please help me.

--
Thanks & Regards,
Vaibhav Shah

Jeet Shandilya

unread,
Sep 5, 2013, 1:23:07 AM9/5/13
to vg...@googlegroups.com

Hi
Vaibhav

For the termination of command we use ; on the end of command...

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+un...@googlegroups.com
To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG
 
---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alpesh Bhavsar

unread,
Sep 5, 2013, 7:19:48 AM9/5/13
to vg...@googlegroups.com
Hi Vaibhav,

While executing script if you want to move process to background, then press "ctrl+ z" and then to start again execution give "bg" command.

Hope it helps.

Shankar Patel

unread,
Sep 6, 2013, 2:46:45 AM9/6/13
to vg...@googlegroups.com
Hi Vaibhav,

you should find a command which is creating logs and use 2>&1 like below

ls /tmp/aa > /dev/null 2>&1

Hope this will help you :)


Thanks & Regards,
Shankar Patel



From: vaibhav shah <shahva...@gmail.com>
To: vg...@googlegroups.com
Sent: Thursday, September 5, 2013 5:17 AM
Subject: [VGLUG] need to do ctrl+d using bash script

niraj vara

unread,
Sep 6, 2013, 1:45:16 AM9/6/13
to vglug
Hi

Please try this command

"nohup script.sh & "

it will run the script  in background. If you exit the terminal then after it will be running in backuground.
Niraj M. Vara
Linux Administrator
Mavenvista Pvt. Ltd.
Mobile : 8000977677

"DON'T TELL ME THE SKY IS THE LIMIT, THERE ARE FOOTPRINTS ON THE MOON"

vaibhav shah

unread,
Sep 9, 2013, 12:42:40 AM9/9/13
to vg...@googlegroups.com
HI Niraj,

Thanks for help. Yes, nohup command worked for me.


Thanks,
Vaibhav


Vaibhav Shah
+919714428883

Kavit Munshi

unread,
Sep 9, 2013, 1:25:04 AM9/9/13
to vg...@googlegroups.com
also try using screen to run the command and preserve the session.

screen  yourcommand




Kavit Munshi
Chief Technology Officer
EVP Aptira India 

+91 97129 29850
+612 8030 2333
1800 APTIRA
aptira.com
Follow @aptira
Follow @kavitaptira

Reply all
Reply to author
Forward
0 new messages