« first day (2959 days earlier)      last day (1978 days later) » 

12:40 AM
@Kusalananda Does source script first ensures the right syntax of complete script before executing it?
where as ./script parses and executes line by line.
 
 
2 hours later…
2:41 AM
#!/bin/sh
cd /a/b/c
con_command # gives error - con_command is located in /a/b/c folder
./con_command # works fine
in Linux
But in solaris 10
below code works fine
#!/usr/bin/ksh
cd /a/b/c
con_command # works fine
 
 
4 hours later…
6:30 AM
@overexchange You know that $PATH determines where the cemmands will be taken from if no explicit path is given to the command on the command line.
 
 
1 hour later…
7:49 AM
@overexchange Depending on whether con_command is a script or a function, the FPATH variable may also come into play. You really need to read and understand the script you are porting from Solaris to Linux, especially if you are porting it to a new shell.
 
8:03 AM
ok
@Kusalananda Does bash read .profile? Because I set some environment variable in .profile but it does not take into effect
 
@overexchange It does, but only if there is no .bash_profile.
 
ok ok
 
... but only when invoked as a login shell.
 
hmm... am trying to understand serverfault.com/a/376264/220043
login shell
 
253
Q: Difference between Login Shell and Non-Login Shell?

IgorioI understand the basic difference between an interactive shell and a non-interactive shell. But what exactly differentiates a login shell from a non-login shell? Can you give examples for uses of a non-login interactive shell?

 
8:08 AM
we actually do sudo su - username and then start application
so this is login shell
@Kusalananda So... basically 1) I have ksh88 running scripts in solaris 10 with shebang line #!/usr/bin/ksh 2) /bin/sh -> /sbin/sh Bourneshell running scripts in solaris 10 with shebang line #!/bin/sh
I need to port these two categories of scripts to Linux box that has ksh93 and /bin/sh -> bash
Looks like there is no bourne shell in RHELinux box
I do not want to change the shebang lines...
and port the scripts from solaris to Linux
 
Porting is difficult. I can't say "do this and it will work". You will have to read and understand the scripts, and then reimplement the things that work differently between the two systems. There are no shortcuts.
I can't emphasise this enough, you absolutely have to look at every single line of the scripts that you port to make sure that you understand what it is doing on Solaris and what it would do on Linux running under a different shell.
You have to understand how sh and ksh works on Solaris and you have to understand how sh works on your Linux system.
 
8:25 AM
/bin/sh -> /bin/bash in Linux which is bash shell
/bin/sh -> /sbin/sh in solaris 10, which is bourneshell
 
Both are sh, so the syntax, grammar, and shell initialisation etc. should be similar.
 
One is bourneshell and other is bash shell.. aren't they different?
27
A: Difference between sh and bash

PremrajShell is an interface between a user and OS to access to an operating system's services. It can be either GUI or CLI (Command Line interface). sh (Bourne shell) is a shell command-line interpreter, for Unix/Unix-like operating systems. It provides some built-in commands. In scripting language we...

 
@overexchange sh on your Linux is bash running in POSIX compatibility mode, i.e. as if bash --posix was used. You should really be looking at the bash manual.
 
8:55 AM
ok
 
9:35 AM
@overexchange anything written for bourne shell will work fine on bash. The problem is translating bash stuff to bourne, not bourne stuff to bash.
Essentially, bash contains sh, so anything that sh understands, bash will understand also.
 
9:46 AM
@terdon You also have to take the Solaris environment into account, and how it differs from Linux. You simply can't say "this script will work on Linux, because it uses sh".
If he's porting an application (that is evidently running as root), and he's doing it as part of his job, then assuming that the scripts will work because they use the same shell variant is both negligent and dangerous.
 
Urgh yes, in a previous life I had to write shell scripts which would work on ksh88 on Solaris, ksh93 (IIRC) on AIX, and bash on Linux. There are significant, non-shell-related differences between all three. The answer really depends on what the shell script is supposed to do...
 
Using sh on both systems does make it easier though. It allows one to look at environmental differences instead of porting syntax and grammar.
 
10:09 AM
@Kusalananda No, I just mean the script will run and the syntax won't need to be changed. Now, whether or not the scripts will do what they are supposed to is another matter.
 
 
4 hours later…
Tim
1:53 PM
@StephenKitt Thanks. (1) In C, when does execution of function definitions happen?
(2) In all these languages, what is "execution of function definitions"? What result is "execution of function definitions " expected to generate? In all these languages, is "execution of function definitions " expected to create a "link" between the function names and their implementations, so that when executing a function call the interpreter can find the function implementation? Is this linking in C, interpretation in Bash, and compilation in awk?
 
2:35 PM
@terdon what about ksh88(Solaris 10) to ksh93(Rhel 7.5) porting?
 
Shouldn't be an issue, going from ksh93 to ksh88 would be where you find problems
 
@Kusalananda having.... shell variants + OS variants ...... as an adding factor for complexity... When you say... porting is difficult... Can I take it as.... syntax and semantic errors MAY BE uncovered during execution time but not parsing time?
 
3
A: Migrating shell scripts from Solaris 10 to RHEL 7.5

KusalanandaYou may not migrate the code without looking at it. You need to test run the scripts in a safe environment and compare the results with the expected result for the same test on Solaris. You should also investigate if the fail conditions are the same on both system (missing files, invalid data,...

 
@overexchange It's more likely that you will run into application issues and/or will be attempting to use files/directories that don't exist on one system but do on the other
 
It doesn't matter if all of your variable expansions are error-free if the underlying commands to gather that information (or pass it along) are different.
 
2:43 PM
As Jeff said probably the biggest issue will be that rhel will have gnu tools where your solaris system probably does not
 
@Kusalananda For sure.... am not shy to visit each and every line....but trying to grab the complexities in porting exercise before I start doing it....
 
What made you change your mind?
> unix.stackexchange.com/questions/481602/… "Checking line by line is not a wise idea..."
 
I did port C code from 32 bit OS to 64 bit OS.. but I did not expect the same initially.....
In case of shell script
As Stephen says.... the answer really depends on what the shell script is supposed to do...
@JeffSchaller we did not visit each line of C code instead we relied on level 1, level 2, level 3 warnings from C compiler...
It was 200 MB odd Source code
So... I was looking for such approach for porting shell scripts...
But... shell script environment is like interpreter based environment similar to python
@JeffSchaller So... I think... I changed my mind because.... as I already said... syntax and semantic errors will be uncovered in execution time but not parse time...
Am trying to confirm the same with @Kusalananda
 
@overexchange a compiler will complain about syntax errors, it won’t tell you about (most) semantic errors arising from the porting exercise
that’s where inspecting the programs comes in, and testing them
 
give a try...with gcc and nmake
 
2:57 PM
It’s a bit like trying to translate jokes, especially word play, from one language to another, but only caring about the grammar.
 
Do you not have a test rhel environment?
 
@StephenKitt I think you should give a try...
 
If you want to take a yolo approach just do it on a test server and see what happens
 
Int ptr = malloc();
Compiler will warn you...
 
@overexchange I don’t need to give it a try, I’ve been porting programs for over 25 years.
@overexchange but that’s not an error related to porting at all. It’s a basic C error.
 
3:01 PM
It’s a porting related error... I don’t know what C error mean...
Compiler generates object files in both 32 bit and 64 bit
For above code...
But also warn you...
@Jesse_b yes we are taking lab server... for this...
 
useless use of ellipsis
 
Ok
If you are happy throwing such comments... then good for you...
Doesn’t intimidate me....
 
You're coming across very poorly. You are asking for help and then essentially telling everyone they are wrong. Your over/misuse of ellipsis don't help. So yes I am happy using these comments.
"I need help with this problem but I already know everything..."
 
I disagree with this... I completely agree with this latest comment from @Kusalananda in that answer....
 
3:23 PM
The latest comment is just telling you what everyone else has been telling you for the past few hours: you need to check this manually and cannot just copy the scripts over and expect they will work even if the shell is the same.
 
@overexchange One suggestion, since you mentioned that you haven't really started on this porting project yet, would be to start doing it. Then, if anything turns up that you really can't resolve on your own or with the help of colleagues or the Internet, you could formulate it as a question for this site. At the moment it sounds like you are actively looking for things that may be difficult or that you may have issues with.
The complexities of porting a set of scripts can be huge, but it could also be trivial. You haven't started yet so there's no way of knowing.
 
Sure....
 
@overexchange You see, I'm on one hand saying that you need to be careful (see many previous comments), but on the other hand I'm saying that you can't really know what to be careful about until you've started. In any case, you have to do test runs and code reading.
 
Bonjour everyone
 
3:32 PM
@PrabhjotSingh God afton.
 
Hello Prabhjot
 
@Jesse_b The problem is that he is consistently not asking for "help". He is asking that people thinks for him without trying and people validate actions....complicated.
 
Yeah, I feel like he's just trying to find an easy way out which I cannot blame him for. I always try to find the easiest way to accomplish a task, but in this case there isn't really an easy way.
 
@Jesse_b Nah, he is just constantly asking for cut and dried recipes when the questions involve some thinking...and then posts things in the group and often is so eager to mik and the possible answers from someone that gives some time to him that he does not realize he can be tiring. I think...
 
Whenever there is a hard job to be done I assign it to a lazy man; he is sure to find an easy way of doing it.
- Walter Chrysler
 
3:46 PM
@Jesse_b lol
 
@RuiFRibeiro That's my mantra
 
 
1 hour later…
4:57 PM
I cringe at long pipelines >.<
 
5:44 PM
Hi folks.
 
5:59 PM
Hello Faheem
 
6:42 PM
@Jesse_b Hi.
 
@FaheemMitha wat it do?
 
@Jesse_b Huh?
 
Whats up?
 
@Jesse_b Impressive. I worked for someone like that once. He was a PI. I suppose my PI.
@Jesse_b Life is currently very scary.
I'm hoping for good news, but not optimistic.
 
I'm sorry to hear that. I'm sure you can pull through it
 
6:46 PM
@Jesse_b I expect I'll be alive at the end of it, yes.
 
seize the carp
 
@Jesse_b What?
 
@FaheemMitha carpe diem
 
@Jesse_b Too scary to be funny, sorry.
I guess you're trying to "lighten the mood"?
 
I always try to add humor :(. I don't deal well with serious
 
6:49 PM
@Jesse_b Sorry, I can't summon any humor right now.
 
That's alright, I'll just keep throwing it out until something sticks. At the very least my lack of humor will be humorous
Do you want to talk about what's going on?
 
@Jesse_b Just too scared right now.
@Jesse_b Not that complicated. My mother is pretty sick.
And she's my last living family.
 
@FaheemMitha oh yes, I remember. That's a terrible situation for sure.
 
I'm trying to cope.
 
well there is certainly no shame in having a hard time with that. I think the only thing that will help is lots of time
Have you been spending a lot of time with her?
 
6:57 PM
@Jesse_b I'm been living with her and taking care of her for years. She has dementia, so it hasn't been easy.
Actually, it's probably in large part due to the dementia that she is so sick.
 
Yeah, my grandfather had dementia towards the end of his life, but not terribly bad. He would usually remember things but about 30% of the time he either didn't know who he was or thought he was at earlier periods of his life
 
@Jesse_b My mother's short term memory has almost totally gone. And her long term memory is mostly gone too.
 
That's rough, I'm sorry
 
If she had her normal mental faculties, we wouldn't be in this situation right now.
For that matter, if I had had my wits about me a bit more, I would have kept a closer watch on her.
But she didn't make it easy. She was increasingly uncooperative.
 
I'm sure she is scared and confused
 
7:04 PM
@Jesse_b Confused, yes. I don't know about scared. You mean generally, or right now?
 
I would be scared if I couldn't remember things
 
@Jesse_b I'm not sure that's how dementia works, but I'm not sure anyone knows what goes on in the mind of someone with dementia.
 
Have any doctors recommended stem cells? I've heard they are making pretty big advancements in mental health by using them.
My grandfather would often wake up in the middle of the night really scared. He didn't know where he was...or even who he was some times.
I couldn't imagine not knowing who I am
 
@Jesse_b To be clear, the illness isn't dementia. The dementia is just a bonus.
@Jesse_b She still remembers who she is.
 
7:47 PM
@FaheemMitha My mother died from Alzheimer's disease. When serious memory loss started to set in, she would be very scared. She would not know where she was or who the people around her were, and she wanted to go back home "to mom and dad". I think she got used to it after some time though. She always recognised me, though did not know my name.
 
 
1 hour later…
8:50 PM
@Kusalananda Very sorry to hear that. These dementia diseases are very painful.
 
@FaheemMitha Alzheimer's disease is mostly a "relative's disease". It's the relatives that suffer the most.
 
@Kusalananda Friends too.
Though in my mother's case I think she's mostly outlived her friends. Or they moved away, perhaps.
One of her favorite phrases in recent years has been "All my friends are dead".
 
user141350
@Kusalananda I'm sorry for your loss and sorry to read what you described. Condolences to you and your family.
 
9:07 PM
Well, perhaps not favorite. But she certainly used to say it, more than once.
 
9:20 PM
@FaheemMitha I think that's a common thought among elderly people. It really shines a light on your mortality when your peers start to die of natural causes but is probably much more intense when all or almost all of them have passed.
 
Youtube has started giving me 400 errors in the last few days. Probably an Indian thing, but just in case, is anyone else seeing it?
@Jesse_b My mother also has a history of depression. She was manic-depressive back in 199-1994. I was in India and with her at the time. It was very stressful.
But yes, it does have an impact when people you knew are dying around you.
 
@FaheemMitha Youtube was hard down for me a day or two ago for like 10 minutes
 
@Jesse_b Not quite the same thing.
 
:-) Just had a reverse "Everyone's using GNU tools" issue: unix.stackexchange.com/a/482042/116858
 
I did a check. It's probably a cache/cookies issue. I might have had it before, actually.
 
9:36 PM
I could really use a cache of cookies right now, amiright?
 
@Jesse_b :-)
Deleting youtube-specific cookies doesn't seem to have fixed it, unfortunately.
Should I need to restart the browser? What do you guys think?
 
Probably couldn't hurt. Modern browsers like to go wonky after being open for too long
 
Incognito mode works, so it's not being blocked or anything.
@Jesse_b My browser doesn't stay up too long, these days.
 
10:12 PM
Restarted browser. Still getting that error.
Ok. It seems fixed, at least for the moment. But since I have no idea what caused it, it might happen again...
Some days I pine for a simpler world.
 

« first day (2959 days earlier)      last day (1978 days later) »