LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-21-2023, 03:42 AM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Rep: Reputation: Disabled
Question 'history' & 'exit' commands not executing in script


When I execute this basic script in urxvt (terminal app):

Code:
#!/bin/sh
reset
history -c
exit
reset executes, history remains, & the windows stays open (does not exit)
 
Old 06-21-2023, 03:53 AM   #2
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,020

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
By default script executes in a new environment, if you want to execute it in the current environment start it as '. script_name'
 
2 members found this post helpful.
  


Reply

Tags
command line, scripts, terminal, urxvt



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Difference between executing multiple commands with && and ; or Both same. jaydul Linux - Newbie 1 05-19-2019 04:16 PM
Crontab not executing my shell script its executing standlaone atulkvtiwari Linux - Newbie 15 12-04-2018 06:25 AM
Problems executing perl script with inputs when executing under other perl scripts TheStr3ak5 Programming 4 04-22-2017 04:07 AM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration