The below shell script obtains a command and an alias from the user then appends the alias to the users ~/.aliases file. It is useful with cd commands and saves typing; instead of going cd /foo/bar/bonk/boo/what/whatelse/dir I create an alias something like "godir".
It's not done and I will post it on this thread when it is. If you want to use it, add "source ~/.aliases" to ~/.bashrc, if it's not there. I hereby release it to the public domain.
My problem is I'd like to use the alias as soon as the script exits, but
doesn't affect the environment of the shell running in the terminal window within which the script is invoked. How would this be done?
Eternal gratitude for the being who helps me solve this puzzle.
You cannot change anything in the parent environment. If you want a script to change the calling environment, it must be sourced, not executed. (Or put it in a function.)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi All,
I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file.
comm -3 < sort file_old < sort file_new > new_file
I am getting the below error:
-ksh: sort: cannot open
But if I do... (7 Replies)
Hi guys,
Hope u r doing find. I have this query. When we check the manual pages for a certain command, say man cat
we see the manual page with more
What is UNIX really doing here, I mean why not less command instead of more command. And can we have UNIX display the manual pages with less command... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
I'm a bit confused. Maybe some master can explain to me what is happening.
I have a program that starts issuing output about himself loading.
I want to run it in another thread but I want to wait untill it's fully loaded.
Program sample:
$ cat myprogram
echo "loading"
echo "almost... (3 Replies)
hi there, could use some basic PATH advice, i think, or something
find sometimes work, but which hasn't ever seemed to. for years!
what am i doing wrong that the commands which and find rarely work?
they used to work on the workstations i used ages ago...
running 10.5.8 because i... (4 Replies)
im a new student in programming and im stuck on this question so please please HELP ME. thanks.
the question is this:
enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Why would anyone ever type in a command like this:
nohup command &
nohup lets you logout of your telnet session so why add "&" to run it in the background? (1 Reply)
Hi,
We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0.
Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ?
I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc.
... (1 Reply)