Search Results

Search: Posts Made By: therealtiger
6,167
Posted By therealtiger
Final Answer
Actually, this one is much better.

CURR_ENV=`echo $0 | xargs -i expr {} : '\(.*devl\)' \| {} : '\(.*stage\)' \| {} : '\(.*prod\)' \| \`pwd\` | xargs -i expr {} : '\(.*devl\)' \| {} : '\(.*stage\)'...
6,167
Posted By therealtiger
I got it. Thanx. Here is the command. ...
I got it. Thanx.

Here is the command.

CURR_ENV=`echo $0 | xargs -i expr {} : '\(.*devl\)' \| {} : '\(.*stage\)' \| {} : '\(.*prod\)' \| "Invalid." : '\(.*Invalid.\)' | xargs basename`
...
6,167
Posted By therealtiger
That works fine by itself, now I want to pull out...
That works fine by itself, now I want to pull out the "environment" (development, stage or production) I am in by examining the path where the script resides. The "environment" may not be in the...
6,167
Posted By therealtiger
I've got one I haven't been able to figure out. ...
I've got one I haven't been able to figure out.

1. A shell script exists- /junk/junk1/junk2/junk3.sh
2. From within the above named shell script, I want to know the full path of the above named...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy