You are not logged in.

#1 2019-03-03 08:14:50

huzo11
Member
Registered: 2018-10-31
Posts: 60

Need to create environments

Hello all! 
I needed to set up a library. But when I look at the instructions:

1. Extract the Package. Under Linux:

   cd $HOME
   tar -zxvf simpl.tar.gz

Note, it will create the directory $HOME/simpl

2. Create the directory where FIFOs live
   (Required by the SIMPL library)

   mkdir $HOME/fifo

3. Set up FIFO_PATH environment variable by adding these to your .cshrc

   setenv SIMPL_HOME $HOME/simpl
   setenv FIFO_PATH $HOME/fifo

TIPS: The SIMPL library make use of the FIFO_PATH to store
temporary files during the messaging. When you encounter strange problem
while running the programs, just quite your program (i.e. press Ctrl-C).
Check if you got some useless processes by:

I cannot find .cshrc file. Doesn't Arch Linux have it? If it doesn't have it, why? 
Then I tried to set environment variables using "export". But that only creates them temporarily. When I reopen the terminal, and

echo $FIFO_PATH

nothing appears. Any ideas about how I can solve the problem? 

Thanks!!


Be nice and live for others.
https://prismatically.blog

Offline

#2 2019-03-03 08:31:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Offline

#3 2019-03-03 08:45:16

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

Thanks for your help. But I am not sure how this link is supposed to help and I don't understand what you are suggesting. Are you suggesting me to install C Shell?


Be nice and live for others.
https://prismatically.blog

Offline

#4 2019-03-03 09:02:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Re: Need to create environments

What does your $SHELL say? Maybe try its config file?

Offline

#5 2019-03-03 09:06:15

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

seth wrote:

What does your $SHELL say? Maybe try its config file?

Well, it says /bin/bash


Be nice and live for others.
https://prismatically.blog

Offline

#6 2019-03-03 09:12:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Re: Need to create environments

Yeah, because that's the default shell in about every distro.
And what did you conclude from this finding?

Offline

#7 2019-03-03 11:28:19

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

seth wrote:

Yeah, because that's the default shell in about every distro.
And what did you conclude from this finding?

That I wish that you were more explicit


Be nice and live for others.
https://prismatically.blog

Offline

#8 2019-03-03 11:28:58

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Need to create environments

huzo11 wrote:

[…] by adding these to your .cshrc

Ugh—I guess this is what happens when "instructions" that only give verbatim commands (without any further explanation) and users who just blindly type whatever they see on the screen (without any further thinking) are combined. Especially when the examples are so outlandish that they rarely apply…

huzo11, what is that library in question? It would be reasonable for the authors to reword those instructions a bit.


pkgs │ hacks │ cfg │ blag

Offline

#9 2019-03-03 12:09:58

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

ayekat wrote:
huzo11 wrote:

[…] by adding these to your .cshrc

Ugh—I guess this is what happens when "instructions" that only give verbatim commands (without any further explanation) and users who just blindly type whatever they see on the screen (without any further thinking) are combined. Especially when the examples are so outlandish that they rarely apply…

huzo11, what is that library in question? It would be reasonable for the authors to reword those instructions a bit.

Hello.

It is called SIMPL by FCsoftware inc. 2002. I could not find the open source project online, but I was provided it by our school for an assignment. I found a better readme file in the project. But following that raised errors hmm

/*============================================================
SIMPL Installation Instructions

$Log: INSTALL.simpl,v $
Revision 1.1.1.1  2005/03/27 11:50:30  paul_c
Initial import

Revision 1.4  2002/10/25 18:59:02  root
use new scripts directory

Revision 1.3  2001/01/09 13:23:52  root
fixed version tag

=============================================================*/

This source code is completely self contained. It will not pollute your
source tree. All it ultimately creates is a static library which you then link
into your applications as you see fit. It is not necessary to patch your
existing LINUX code to enable it.

As such it should be quite independent of the LINUX version you are using.

Step 1: Download the source tar.gz file to your system if you have not already
        done so (~105k)

Step 2: You will need to define 2 environment variables to enable this stuff
        (and create the directories that these point to)

        FIFO_PATH - the path to where you wish the fifos to live
                 eg. export FIFO_PATH=/home/fifo
        SIMPL_HOME - the path to the top of the "simpl" tree where all this
                  stuff is going to live

        NOTE: the SIMPL_HOME environment variable must terminate at a
           subdirectory named "simpl"
        eg. export SIMPL_HOME=/home/simpl

        All the source for this project will be confined to this "simpl"
        directory tree so there is no problem with deinstalling the stuff.

Step 3: To undo the gzip'd tar file simply perform the following steps:

        cd $SIMPL_HOME
        cd .. (yes that's up one level from $SIMPL_HOME)
        <place the simpl.x.x.x.tar.gz here>
        tar -zxvf simpl.x.x.x.tar.gz

        NOTE: Before doing more you may want to read the various bits of
       documentation starting with:

        $SIMPL_HOME/docs/readme.ipc
        That will lead you to all the other readme files.

Step 4: Build the code

    There is a script available to drive the top level Makefile. That
        script is called:

        $SIMPL_HOME/scripts/buildsimpl

        It will output the results from the make to a file called:

        $SIMPL_HOME/make.out

    The code is organized such that all the individual directories
        come with their own Makefile. You can execute localized builds
        by typing:

        make clobber - will remove all .o's and binaries in preparation for
                       a complete rebuild
        make - will perform a build and leave the executable in the local
               ../bin directory
        or
        make install - will do everything that "make" does but also copy
                       the executable to $SIMPL_HOME/bin

Step 5: Run the benchmarking test to see if everything is in order

        Simply follow the instructions contained in the readme at:

        $SIMPL_HOME/benchmarks/src/readme

Step 6: Have fun with the stuff.

        If you have any problems, comments or suggestions for improvement
        don't hesitate to contact the mailing list.

NOTE:
As with most things it represents a "work in progress". FCsoftware has been
using the various versions of this code in several projects over the past
several years ... so when its not undergoing renovations we have found it to be
a very stable library.


Be nice and live for others.
https://prismatically.blog

Offline

#10 2019-03-03 12:36:17

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Need to create environments

huzo11 wrote:

But following that raised errors hmm

What errors? At which step? smile
I suspect them providing their "helpful" wrapper script (`buildsimpl`) will make this harder to debug, though…


pkgs │ hacks │ cfg │ blag

Offline

#11 2019-03-03 12:45:07

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

ayekat wrote:
huzo11 wrote:

But following that raised errors hmm

What errors? At which step? smile
I suspect them providing their "helpful" wrapper script (`buildsimpl`) will make this harder to debug, though…

This is my make.out file that is mentioned:

Sun Mar  3 19:57:31 HKT 2019
==================================================
SIMPL_HOME = /home/huzo_user/simpl
FIFO_PATH = /home/huzo_user/fifo
SIMPL version:
=========================
Version: 3.3.8
Created on: Tue Oct 30 16:31:57 EST 2012
=========================
OS_TYPE = _LINUX_OS
==================================================
running make clean
==================================================
SIMPL Top Level clean starting
make -C simplipc clean
make[1]: Entering directory '/home/huzo_user/simpl/simplipc'
SIMPL fclogger <clean> starting
make -C src -s clean
make[2]: Entering directory '/home/huzo_user/simpl/simplipc/src'
simpl clean
make[2]: Leaving directory '/home/huzo_user/simpl/simplipc/src'
make -C test -s clean
make[2]: Entering directory '/home/huzo_user/simpl/simplipc/test'
simplipc/test clean
make[2]: Leaving directory '/home/huzo_user/simpl/simplipc/test'
SIMPL fclogger <clean> done
make[1]: Leaving directory '/home/huzo_user/simpl/simplipc'
make -C simplUtils clean
make[1]: Entering directory '/home/huzo_user/simpl/simplUtils'
SIMPL simplUtils <clean> starting
make -C src -s clean
make[2]: Entering directory '/home/huzo_user/simpl/simplUtils/src'
simplUtils/src clean
make[2]: Leaving directory '/home/huzo_user/simpl/simplUtils/src'
make -C test -s clean
make[2]: Entering directory '/home/huzo_user/simpl/simplUtils/test'
testbinstr clean
make[2]: Leaving directory '/home/huzo_user/simpl/simplUtils/test'
SIMPL simplUtils <clean> done
make[1]: Leaving directory '/home/huzo_user/simpl/simplUtils'
make -C surrogates clean
make[1]: Entering directory '/home/huzo_user/simpl/surrogates'
SIMPL surrogate <clean> starting
make -C protocol_router -s clean
make[2]: Entering directory '/home/huzo_user/simpl/surrogates/protocol_router'
SIMPL surrogate/protocol_router <clean> starting
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/protocol_router/src'
protocolRouter clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/protocol_router/src'
SIMPL surrogate/protocol_router <clean> done
make[2]: Leaving directory '/home/huzo_user/simpl/surrogates/protocol_router'
make -C tcp -s clean
make[2]: Entering directory '/home/huzo_user/simpl/surrogates/tcp'
SIMPL surrogate/tcp <clean> starting
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tcp/src'
surrogate clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp/src'
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tcp/test'
test clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp/test'
SIMPL surrogate/tcp <clean> done
make[2]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp'
make -C tcp_x -s clean
make[2]: Entering directory '/home/huzo_user/simpl/surrogates/tcp_x'
SIMPL surrogate/tcp <clean> starting
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tcp_x/src'
surrogate clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp_x/src'
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tcp_x/test'
test clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp_x/test'
SIMPL surrogate/tcp <clean> done
make[2]: Leaving directory '/home/huzo_user/simpl/surrogates/tcp_x'
make -C rs232 -s clean
make[2]: Entering directory '/home/huzo_user/simpl/surrogates/rs232'
SIMPL surrogate/rs232 <clean> starting
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/rs232/src'
surrogate clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/rs232/src'
SIMPL surrogate/rs232 <clean> done
make[2]: Leaving directory '/home/huzo_user/simpl/surrogates/rs232'
make -C tclSurrogate -s clean
make[2]: Entering directory '/home/huzo_user/simpl/surrogates/tclSurrogate'
SIMPL tclSurrogate <clean> starting
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tclSurrogate/src'
tclSurrogate clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tclSurrogate/src'
make[3]: Entering directory '/home/huzo_user/simpl/surrogates/tclSurrogate/test'
tclSurrogate clean
make[3]: Leaving directory '/home/huzo_user/simpl/surrogates/tclSurrogate/test'
SIMPL tclSurrogate <clean> done
make[2]: Leaving directory '/home/huzo_user/simpl/surrogates/tclSurrogate'
SIMPL surrogate <clean> done
make[1]: Leaving directory '/home/huzo_user/simpl/surrogates'
make -C fclogger clean
make[1]: Entering directory '/home/huzo_user/simpl/fclogger'
SIMPL fclogger <clean> starting
make -C src -s clean
make[2]: Entering directory '/home/huzo_user/simpl/fclogger/src'
fclogger clean
make[2]: Leaving directory '/home/huzo_user/simpl/fclogger/src'
make -C test -s clean
make[2]: Entering directory '/home/huzo_user/simpl/fclogger/test'
fclogger test clean
make[2]: Leaving directory '/home/huzo_user/simpl/fclogger/test'
SIMPL fclogger <clean> done
make[1]: Leaving directory '/home/huzo_user/simpl/fclogger'
make -C benchmarks/src clean
make[1]: Entering directory '/home/huzo_user/simpl/benchmarks/src'
benchmark clean
make[1]: Leaving directory '/home/huzo_user/simpl/benchmarks/src'
SIMPL TOP LEVEL clean done
==================================================
running make install
==================================================
SIMPL Top Level Build install starting
Sun Mar 3 19:57:38 HKT 2019
make -C simplipc install SIMPL_BIN=`pwd`/bin SIMPL_LIB=`pwd`/lib SIMPL_INCL=`pwd`/include
make[1]: Entering directory '/home/huzo_user/simpl/simplipc'
SIMPL fclogger build <install> starting
Sun Mar 3 19:57:38 HKT 2019
make -C src install SIMPL_BIN=/home/huzo_user/simpl/bin SIMPL_LIB=/home/huzo_user/simpl/lib SIMPL_INCL=/home/huzo_user/simpl/include
make[2]: Entering directory '/home/huzo_user/simpl/simplipc/src'
simpl starting
cc -c  -D_LINUX_OS -D_STABLE -fPIC -O -Wall -I../include -I../../include -o obj/simpl.o simpl.c
In file included from simpl.c:151:
../../include/simplLibProto.h:113:12: warning: inline function '_simpl_check' declared but never defined
 inline int _simpl_check(void);
            ^~~~~~~~~~~~
../../include/simplLibProto.h:111:13: warning: inline function '_simpl_setErrorCode' declared but never defined
 inline void _simpl_setErrorCode(int);
             ^~~~~~~~~~~~~~~~~~~
simpl.c: In function 'name_attach':
simpl.c:362:24: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
 sprintf(remoteName,"_%s",processName);
                        ^
simpl.c:362:1: note: 'sprintf' output between 2 and 33 bytes into a destination of size 32
 sprintf(remoteName,"_%s",processName);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simpl.c: In function 'Reply':
simpl.c:953:22: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
 sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath, msgPtr->whom, msgPtr->pid);
                      ^~
simpl.c:953:1: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
 sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath, msgPtr->whom, msgPtr->pid);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simpl.c: In function 'whatsMyRecvfd':
simpl.c:1155:24: warning: '%s' directive writing up to 31 bytes into a region of size between 0 and 127 [-Wformat-overflow=]
  sprintf(fifoName, "%s/%s.%d", _simpl_fifoPath,
                        ^~
          _simpl_myStuff.whom,
          ~~~~~~~~~~~~~~~~~~~
simpl.c:1155:2: note: 'sprintf' output between 4 and 172 bytes into a destination of size 128
  sprintf(fifoName, "%s/%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          _simpl_myStuff.whom,
          ~~~~~~~~~~~~~~~~~~~~
          _simpl_myStuff.pid);
          ~~~~~~~~~~~~~~~~~~~
simpl.c: In function 'whatsMyReplyfd':
simpl.c:1200:23: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
  sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath,
                       ^~
simpl.c:1200:2: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
  sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          _simpl_myStuff.whom,
          ~~~~~~~~~~~~~~~~~~~~
          _simpl_myStuff.pid);
          ~~~~~~~~~~~~~~~~~~~
simpl.c: In function 'simplCheckProcess':
simpl.c:1333:25: warning: '%s' directive writing up to 31 bytes into a region of size between 0 and 127 [-Wformat-overflow=]
   sprintf(fifoFile, "%s/%s.%d", _simpl_fifoPath, rec->whom, rec->pid);
                         ^~
simpl.c:1333:3: note: 'sprintf' output between 4 and 172 bytes into a destination of size 128
   sprintf(fifoFile, "%s/%s.%d", _simpl_fifoPath, rec->whom, rec->pid);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simpl.c:1338:24: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
   sprintf(fifoFile, "%s/Y%s.%d", _simpl_fifoPath, rec->whom, rec->pid);
                        ^~
simpl.c:1338:3: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
   sprintf(fifoFile, "%s/Y%s.%d", _simpl_fifoPath, rec->whom, rec->pid);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -c  -D_LINUX_OS -D_STABLE -fPIC -O -Wall -I../include -I../../include -o obj/simplUtils.o simplUtils.c
simplUtils.c: In function '_simpl_FifoRename':
simplUtils.c:1225:23: warning: '.' directive writing 1 byte into a region of size between 0 and 127 [-Wformat-overflow=]
 sprintf(oldName,"%s/%s.%d", _simpl_fifoPath, oldSimplName, mypid);
                       ^
simplUtils.c:1225:1: note: 'sprintf' output 4 or more bytes (assuming 131) into a destination of size 128
 sprintf(oldName,"%s/%s.%d", _simpl_fifoPath, oldSimplName, mypid);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simplUtils.c:1226:23: warning: '.' directive writing 1 byte into a region of size between 0 and 127 [-Wformat-overflow=]
 sprintf(newName,"%s/%s.%d", _simpl_fifoPath, newSimplName, mypid);
                       ^
simplUtils.c:1226:1: note: 'sprintf' output 4 or more bytes (assuming 131) into a destination of size 128
 sprintf(newName,"%s/%s.%d", _simpl_fifoPath, newSimplName, mypid);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simplUtils.c:1230:21: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
  sprintf(oldName,"%s/Y%s.%d", _simpl_fifoPath, oldSimplName, mypid);
                     ^~
simplUtils.c:1230:2: note: 'sprintf' output 5 or more bytes (assuming 132) into a destination of size 128
  sprintf(oldName,"%s/Y%s.%d", _simpl_fifoPath, oldSimplName, mypid);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simplUtils.c:1231:21: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
  sprintf(newName,"%s/Y%s.%d", _simpl_fifoPath, newSimplName, mypid);
                     ^~
simplUtils.c:1231:2: note: 'sprintf' output 5 or more bytes (assuming 132) into a destination of size 128
  sprintf(newName,"%s/Y%s.%d", _simpl_fifoPath, newSimplName, mypid);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simplUtils.c: In function 'ReplyError':
simplUtils.c:1369:22: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
 sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath,
                      ^~
simplUtils.c:1369:1: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
 sprintf(fifoName, "%s/Y%s.%d", _simpl_fifoPath,
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         msgPtr->whom,
         ~~~~~~~~~~~~~
         msgPtr->pid);
         ~~~~~~~~~~~~
simplUtils.c: In function '_simpl_initFifo':
simplUtils.c:988:19: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
  sprintf(name, "%s/Y%s.%d", _simpl_fifoPath,
                   ^~
simplUtils.c:988:2: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
  sprintf(name, "%s/Y%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.pid);
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c:981:20: warning: '%s' directive writing up to 31 bytes into a region of size between 0 and 127 [-Wformat-overflow=]
  sprintf(name, "%s/%s.%d", _simpl_fifoPath,
                    ^~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c:981:2: note: 'sprintf' output between 4 and 172 bytes into a destination of size 128
  sprintf(name, "%s/%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.pid);
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c: In function '_simpl_destroyFifo':
simplUtils.c:1057:19: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
  sprintf(name, "%s/Y%s.%d", _simpl_fifoPath,
                   ^~
simplUtils.c:1057:2: note: 'sprintf' output between 5 and 173 bytes into a destination of size 128
  sprintf(name, "%s/Y%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.pid);
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c:1050:20: warning: '%s' directive writing up to 31 bytes into a region of size between 0 and 127 [-Wformat-overflow=]
  sprintf(name, "%s/%s.%d", _simpl_fifoPath,
                    ^~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c:1050:2: note: 'sprintf' output between 4 and 172 bytes into a destination of size 128
  sprintf(name, "%s/%s.%d", _simpl_fifoPath,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.whom,
         ~~~~~~~~~~~~~~~~~~~~
         _simpl_myStuff.pid);
         ~~~~~~~~~~~~~~~~~~~
simplUtils.c: In function '_simpl_statFifoName':
simplUtils.c:1138:28: warning: '%s' directive writing up to 255 bytes into a region of size between 0 and 127 [-Wformat-overflow=]
      sprintf(fifoFile, "%s/%s", _simpl_fifoPath, file->d_name);
                            ^~
simplUtils.c:1138:6: note: 'sprintf' output between 2 and 384 bytes into a destination of size 128
      sprintf(fifoFile, "%s/%s", _simpl_fifoPath, file->d_name);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simplUtils.c:1140:27: warning: '/Y' directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
      sprintf(fifoFile, "%s/Y%s", _simpl_fifoPath, file->d_name);
                           ^~
simplUtils.c:1140:6: note: 'sprintf' output between 3 and 385 bytes into a destination of size 128
      sprintf(fifoFile, "%s/Y%s", _simpl_fifoPath, file->d_name);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar vrs ../lib/libsimpl.a obj/simpl.o obj/simplUtils.o	
ar: creating ../lib/libsimpl.a
a - obj/simpl.o
a - obj/simplUtils.o
cp ../lib/libsimpl.a /home/huzo_user/simpl/lib
cp ../include/simpl.h /home/huzo_user/simpl/include
cp ../include/simplProto.h /home/huzo_user/simpl/include
cp ../include/simplDefs.h /home/huzo_user/simpl/include
simpl install
make[2]: Leaving directory '/home/huzo_user/simpl/simplipc/src'
make -C test install
make[2]: Entering directory '/home/huzo_user/simpl/simplipc/test'
simplipc/test build starting
cc -c  -O -Wall -I../include -I../../include -o obj/sender.o sender.c
cc -o ../bin/sender obj/sender.o -L../lib -lsimpl 
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `name_attach':
simpl.c:(.text+0x132): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x160): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x189): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x1b0): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x1bf): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o):simpl.c:(.text+0x224): more undefined references to `_simpl_setErrorCode' follow
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `child_detach':
simpl.c:(.text+0x354): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0x3a7): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `name_locate':
simpl.c:(.text+0x400): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0x46e): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x47a): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x486): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x4e5): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x5b3): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `Receive':
simpl.c:(.text+0x5fb): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0x6bb): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x6c7): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x706): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x749): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `Send':
simpl.c:(.text+0x7b4): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0x8dc): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x8e8): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x903): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x93e): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x980): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `Reply':
simpl.c:(.text+0x9e4): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xace): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xae2): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xaf7): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xb30): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `Relay':
simpl.c:(.text+0xbe1): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `Trigger':
simpl.c:(.text+0xc2e): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xc81): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xc8d): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xc9e): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `name_detach':
simpl.c:(.text+0xcb5): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xcd6): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `sur_detach':
simpl.c:(.text+0xdc5): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xe05): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `whatsMyName':
simpl.c:(.text+0xe40): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xe5b): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `whatsMyRecvfd':
simpl.c:(.text+0xe83): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xece): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0xf1e): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `whatsMyReplyfd':
simpl.c:(.text+0xf73): undefined reference to `_simpl_check'
/usr/bin/ld: simpl.c:(.text+0xfbe): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x100e): undefined reference to `_simpl_setErrorCode'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:104: ../bin/sender] Error 1
make[2]: Leaving directory '/home/huzo_user/simpl/simplipc/test'
make[1]: *** [Makefile:95: install] Error 2
make[1]: Leaving directory '/home/huzo_user/simpl/simplipc'
make: *** [Makefile:132: install] Error 2
==================================================
/home/huzo_user/simpl/bin
==================================================
snapshot of /home/huzo_user/simpl/bin using "ls -tl"
==================================================
total 0
==================================================
snapshot of /home/huzo_user/simpl/bin using "cksum *"
==================================================
==================================================
/home/huzo_user/simpl/lib
==================================================
snapshot of /home/huzo_user/simpl/lib using "ls -tl"
==================================================
total 48
-rw-r--r-- 1 huzo_user wheel 46118 Mar  3 19:57 libsimpl.a
==================================================
snapshot of /home/huzo_user/simpl/lib using "cksum *"
==================================================
2455072682 46118 libsimpl.a
==================================================
Sun Mar  3 19:57:41 HKT 2019
==================================================

Be nice and live for others.
https://prismatically.blog

Offline

#12 2019-03-03 13:12:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Re: Need to create environments

huzo11 wrote:
seth wrote:

Yeah, because that's the default shell in about every distro.
And what did you conclude from this finding?

That I wish that you were more explicit

No, I don't think you want me to be explicit.

You want to be told that the bash equivalent of ~/.cshrc is - drumroll - ~/.bashrc so if you want that variable to show up in bash, you would put it eg. there.
You could also add it to the running shell (only) by simply exporting it.
And you want to read https://wiki.archlinux.org/index.php/En … _variables and in general learn the VERY basics about the system you clearly didn't install yet try to use.

This will however most likely not fix the linker error - the symbol is undefined in simplipc/lib/libsimpl.a and simplipc/src/obj/simpl.o, this is just some unmainained broken shit.
The next thing you're gonna hit is an undefined _simpl_check.
Both function were inlined by some retarded idiot in simplipc/src/simplUtils.c what means they're not exported and cannot be used outside.

Simpl does as simpl is.

Edit: they're also declared inline in include/simplLibProto.h

Last edited by seth (2019-03-03 13:14:46)

Offline

#13 2019-03-03 13:16:46

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: Need to create environments

huzo11 wrote:
seth wrote:

Yeah, because that's the default shell in about every distro.
And what did you conclude from this finding?

That I wish that you were more explicit

be clever, ~/.cshrc is for csh shell, and ~/.bashrc is for bash that you are using (you may need to create it). see https://wiki.archlinux.org/index.php/Bash section configurations.
each shell has its own configuration files. for a global use /etc/ENVIRONMENTS.

Offline

#14 2019-03-03 13:26:59

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Need to create environments

Judging from all those warnings, that seems like some messy pile of code there…

huzo11 wrote:
make[2]: Entering directory '/home/huzo_user/simpl/simplipc/test'
simplipc/test build starting
cc -c  -O -Wall -I../include -I../../include -o obj/sender.o sender.c
cc -o ../bin/sender obj/sender.o -L../lib -lsimpl 
/usr/bin/ld: ../lib/libsimpl.a(simpl.o): in function `name_attach':
simpl.c:(.text+0x132): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x160): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x189): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x1b0): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: simpl.c:(.text+0x1bf): undefined reference to `_simpl_setErrorCode'
/usr/bin/ld: ../lib/libsimpl.a(simpl.o):simpl.c:(.text+0x224): more undefined references to `_simpl_setErrorCode' follow

It seems like somewhere in lib/libsimpl.a they attempt to call the function `_simpl_setErrorCode`, but then the linker doesn't link in the object that contains the implementation for that.

I don't know how to troubleshoot this efficiently without having access to the code in question. If you know some C, you could try to find which source file (and thus which object) holds the implementation for `_simpl_setErrorCode`. Otherwise… the developers might know more.

EDIT, oh, ninja'd twice.

Last edited by ayekat (2019-03-03 13:27:42)


pkgs │ hacks │ cfg │ blag

Offline

#15 2019-03-03 13:42:25

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

seth wrote:
huzo11 wrote:
seth wrote:

Yeah, because that's the default shell in about every distro.
And what did you conclude from this finding?

That I wish that you were more explicit

No, I don't think you want me to be explicit.

You want to be told that the bash equivalent of ~/.cshrc is - drumroll - ~/.bashrc so if you want that variable to show up in bash, you would put it eg. there.
You could also add it to the running shell (only) by simply exporting it.
And you want to read https://wiki.archlinux.org/index.php/En … _variables and in general learn the VERY basics about the system you clearly didn't install yet try to use.

This will however most likely not fix the linker error - the symbol is undefined in simplipc/lib/libsimpl.a and simplipc/src/obj/simpl.o, this is just some unmainained broken shit.
The next thing you're gonna hit is an undefined _simpl_check.
Both function were inlined by some retarded idiot in simplipc/src/simplUtils.c what means they're not exported and cannot be used outside.

Simpl does as simpl is.

Edit: they're also declared inline in include/simplLibProto.h

Thank you, that was insightful. smile  However, I still could not completely figure some things out. For instance when I call export and define some variables, where are they stored in? Or when I do printenv, where are all those listed environment variables stored in? It is neither in /etc/environment nor /etc/profile nor in .bashrc. In fact, my .bashrc mostly consists of aliases.

#!/bin/bash
#  _               _
# | |__   __ _ ___| |__  _ __ ___
# | '_ \ / _` / __| '_ \| '__/ __|
# | |_) | (_| \__ \ | | | | | (__
# |_.__/ \__,_|___/_| |_|_|  \___|

stty -ixon # Disable ctrl-s and ctrl-q.
shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
HISTSIZE= HISTFILESIZE= # Infinite history.

# Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file).
if [ "$EUID" -ne 0 ]
	then export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
	else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
fi

export GPG_TTY=$(tty)

# System Maintainence
alias mw="~/.config/mutt/mutt-wizard.sh"
alias muttwizard="~/.config/mutt/mutt-wizard.sh"
alias sdn="sudo shutdown now"
alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg

# Some aliases
alias e="$EDITOR"
alias p="sudo pacman"
alias SS="sudo systemctl"
alias v="vim"
alias sv="sudo vim"
alias r="ranger"
alias sr="sudo ranger"
alias ka="killall"
alias g="git"
alias trem="transmission-remote"
alias mkd="mkdir -pv"
alias ref="shortcuts && source ~/.bashrc" # Refresh shortcuts manually and reload bashrc
alias bw="wal -i ~/.config/wall.png" # Rerun pywal

# Adding color
alias ls='ls -hN --color=auto --group-directories-first'
alias grep="grep --color=auto"
alias diff="diff --color=auto"
alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting.

# Internet
alias yt="youtube-dl --add-metadata -ic" # Download video link
alias yta="yt -x -f bestaudio/best" # Download only audio
alias YT="youtube-viewer"

shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
vf() { $EDITOR $(fzf) ;}
source /home/huzo_user/.shortcuts

And also, what did you mean by "Simple does as simpl is"? Honestly, I don't have idea about the things that you mentioned about the cause of the error.

Lastly, what difference would it have to use an alternative Command-line shell. So, in this case, should I strictly be using C shell as my default command-line shell? Or there is no difference at all?

Thanks a lot!


Be nice and live for others.
https://prismatically.blog

Offline

#16 2019-03-03 13:46:07

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,533

Re: Need to create environments

http://icanprogram.com/simpl/

Could that be the continuation of the project ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#17 2019-03-03 13:50:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Re: Need to create environments

exports are "stored" in the shell process, they're volatile.
The standard scripts (like bashrc) are just executed w/ the shell.

https://www.urbandictionary.com/define. … pid%20does
The cause of the error is inferior code that doesn't even compile. Do you somehow need this "simpl" thing?

This has nothing to do with your shell, let alone your default shell. Feel free to install and try csh, do NOT purge bash. You'd hate yourself.

Offline

#18 2019-03-03 13:56:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,652

Re: Need to create environments

Lone_Wolf wrote:

http://icanprogram.com/simpl/

Could that be the continuation of the project ?

I actually fetched and inspecte that code.

There's no exuse for
foo.h

inline int foo();

foo.c

inline int foo() { bar(); } 

in library code - except that probably gcc 2.96 did that ;-)

Offline

#19 2019-03-03 14:09:42

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

Yes, I needed Simpl for concurrent programming in our assignment. But I guess I will have to consult with the one in charge of the assignment and inform him. However, I learned quite a bit about Command-line shells and environment variables. Thanks all for sharing your knowledge smile But I still have one question. What are the environment variables listed after printenv? Where are they stored in? Various places? Like I mentioned, I see no such variables in neither .bashrc nor /etc/environment nor /etc/profile.


Be nice and live for others.
https://prismatically.blog

Offline

#20 2019-03-03 14:42:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: Need to create environments

huzo11 wrote:

Yes, I needed Simpl for concurrent programming in our assignment.

I'm not sure how to add the appropriate tact to this - I sincerely do not mean to offend - but you are in a class doing concurrent programming in linux, yet you do not yet have the most basic understanding of using a linux system.  Either you have skipped prerequisites, or your school's curriculum is completely bass-ackwards.  In either case, I'd strongly encourage you to reconsider your learning goals or take a boat-load of extra out of class time to get caught up on what you should already know (i.e. "using linux 101" type material).

huzo11 wrote:

However, I learned quite a bit about Command-line shells and environment variables.

I'm glad you are absorbing some of this - but there's a lot more you really should be familiar with before devling to the depths this class seems to be sending you to.

huzo11 wrote:

What are the environment variables listed after printenv?

They are the variables defined in the current environment - for the present purposes, that'd be the currently running interactive shell.  They are stored in memory only.  This chunk of memory is accessible in a pseudo-filesystem under /proc/self/environ (where /proc/self is actually a link to /proc/PID where PID is a numeric id of the current shell process).

These variables can come from various sources including those that are locally exported with `export VAR=value` as well as /etc/profile and /etc/profile.d/* and various other startup files depending on the shell (~/.bashrc for bash ~/.cshrc for c-shell, etc).  They are also inherited from any parent process of the shell - that's how environment variables work: every process has it's own environment, and under many conditions, that environment is inherited by child processes.  So your shell is a child process of `login` which is a child of `getty` or similar which is itself a child of `systemd` or any other init process.  Also if this is a terminal emulator under X (or wayland) then there are many more processes in that "family tree" as the shell is a child of the terminal emulator which is likely a child of a window manager or similar process.

(edit: various minor edits for clarity)

Last edited by Trilby (2019-03-03 14:49:23)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#21 2019-03-03 15:36:07

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Need to create environments

Trilby wrote:

I'm not sure how to add the appropriate tact to this - I sincerely do not mean to offend - but you are in a class doing concurrent programming in linux, yet you do not yet have the most basic understanding of using a linux system.  Either you have skipped prerequisites, or your school's curriculum is completely bass-ackwards.  In either case, I'd strongly encourage you to reconsider your learning goals or take a boat-load of extra out of class time to get caught up on what you should already know (i.e. "using linux 101" type material).

That is not offending at all, in fact it is true! I am taking a harder version of the course that I should actually be taking next year. Therefore, there are some gaps that I have to fill myself. But, a challenge is never bad smile  Anyways, thanks for the extra information.

About PID, is that the reason why we get a different command history when we open a second terminal before ending the previous one? It is assigned to a different session in /proc/? It is also interesting that there are hundreds of different PIDs. How are they created, or does each PID number have a different meaning?


Be nice and live for others.
https://prismatically.blog

Offline

#22 2019-03-03 15:50:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: Need to create environments

huzo11 wrote:

About PID, is that the reason why we get a different command history when we open a second terminal before ending the previous one?

More or less.  It's not the PID (Processs ID) per se, but the fact that the two terminals are different processes.  When you look at the command history in either one, they only know their own history which they store in memory.  In fact, you should invert your question - what's interesting is not why two simultaneous shells don't share a history, but rather why when you close one shell and start another the new one can keep the history of the old one as it was just in volatile memory.  That behavior is not a default - that is a feature of some shells that will save their history to a file when they shutdown and then reload that file into memory when a new shell is started.  So when you start two shells at the same time, they both load the same history file, but from then on they diverge.

huzo11 wrote:

It [the new shell] assigned to a different session in /proc/?

It is a new process, so yes, it gets a new process ID.  Open two shells then from each run `ls -l /proc/self`.  You will see that each shell has a different /proc/self as it is a special link that points to each processes own /proc/PID directory.

huzo11 wrote:

It is also interesting that there are hundreds of different PIDs. How are they created, or does each PID number have a different meaning?

Every single process on your system has it's own PID.  These are assigned by the kernel incrementally, so no process ID number should ever be reused (until you reboot).  Init (systemd in arch) runs as PID 1, and everything after that gets a higher number.  You can use `pstree -p` to see many currently running processes and their id numbers.  But these are all "userspace" processes.  To see even more use `ps aux` and you'll see that most of the low numbered processes (other than PID 1) are kernel processes.

Last edited by Trilby (2019-03-03 15:53:04)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#23 2019-03-03 20:12:56

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Need to create environments

Trilby wrote:
huzo11 wrote:

It [the new shell] assigned to a different session in /proc/?

It is a new process, so yes, it gets a new process ID.  Open two shells then from each run `ls -l /proc/self`.  You will see that each shell has a different /proc/self as it is a special link that points to each processes own /proc/PID directory.

You've overlooked something. tongue

(same shell)

$ ls -l /proc/self/exe
lrwxrwxrwx 1 eschwartz eschwartz 0 Mar  3 14:53 /proc/self/exe -> /usr/bin/ls*
$ ls -l /proc/self
lrwxrwxrwx 1 root root 0 Feb 20 01:02 /proc/self -> 2795/
$ ls -l /proc/self
lrwxrwxrwx 1 root root 0 Feb 20 01:02 /proc/self -> 2797/

/proc/self/ is going to be the PID of ls, not of the parent shell. Same difference, ultimately, but if you actually want to dereference /proc/self for the bash process itself you'll need to jump through hoops like cd /proc/self && pwd -P


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#24 2019-03-03 20:21:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,531
Website

Re: Need to create environments

Oops, good catch.  In my shell I can also use `readlink -f /proc/self` but that's only due to readlink being a builtin in my ash build (it's an external binary in bash).

Last edited by Trilby (2019-03-03 20:24:48)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB