Simpler bash commands for linux PBA

This commit is contained in:
Shreya 2020-06-13 19:37:01 +05:30
parent a9c763cd9c
commit e2d35ca267
1 changed files with 5 additions and 8 deletions

View File

@ -3,14 +3,11 @@ BASH_STARTUP_FILES = ["~/.bashrc", "~/.profile", "~/.bash_profile"]
def get_linux_commands_to_modify_shell_startup_files():
return [
'if [ -f {0} ] ;', # does the file exist?
'then',
'echo \"# Succesfully modified {0}\" |',
'tee -a',
'{0}', # add comment to file
'echo \"# Succesfully modified {0}\"',
'3<{0} 3<&- |', # check for existence of file
'tee -a', # append to file
'{0}',
'&&',
'sed -i \'$d\' {0} ;', # remove last line of file
'else',
'echo \"{0} does not exist\" ; fi' # mention if file does not exist
'sed -i \'$d\' {0}', # remove last line of file
],\
BASH_STARTUP_FILES