I am not able to figure out why this is happening, could you all please help me. What changes should i make in the command so that it will return me the same output as it is giving in unix enviornment i.e .
Please help
Thanks.
---------- Post updated at 07:09 AM ---------- Previous update was at 06:45 AM ----------
I read on the whence command one point i would like to share is it detects it detects commands and aliases, and searches your path.
So my script path is searched properly in unix env... whereas this is not happening in the linux enviornment.
Could you all please help me in modifying the command so that i get the exact path of my script.
---------- Post updated at 11:35 PM ---------- Previous update was at 07:09 AM ----------
HI
To get the path in linux i tried
Where $0 will be script name.
My question is if i am using PWD instaed of whence in linux what difference it can cause to my script.
'unix env' does not mean very much. Which OSs are you actually talking about?
whence is most likely returning nothing because the directory containing the script is not in $PATH - which is nothing to do with differences in the OS, you just have them set up differently.
Whether ${PWD} will work depends on how and where the script is being run.
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Hi Team,
I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system.
df -h | awk -v host=`hostname` '
BEGIN {
print "<table border="4"... (13 Replies)
Hello There -
Iam trying to get this expdp running for oracle backup.
And this is the code below:
### Run the export.
### Comment out any LOGFILE parameters in the .par file.
if grep -i "Logfile" /<Path>$1_$2_$3.par; then
## Comment out any LOGFILE... (7 Replies)
This is my sample file
cat bipin.txt
Unix is an OS
Unix has its own commmands
Unix is a user friendly OS
Unix is platform independent
Unix is a time sharing OS
the best OS to learn is Unix
Abinitio uses Unix in backend
When i use sed 's/Unix/Linux/' bipin.txt , only the first... (2 Replies)
cat bipin.txt
Unix is an OS
Unix has its own commmands
Unix is a user friendly OS
Unix is platform independent
Unix is a time sharing OS
the best OS to learn is Unix
Abinitio uses Unix in backend
this is my file
when i use sed 's/Unix/Linux/' bipin.txt all the occurences are getting... (0 Replies)
Hi All,
I am trying to run a sed command to replace a string in a file.
sed -i -e "s/$Job_status_old ,$line/Job_status_new ,$line/g" stat.txt
The command wen run from the command promt works fine.
But the same command does not work when its put in a script.
The script is not failing... (3 Replies)
Hi guys,
the command is
echo "Online Memory : 32768 MB" | sed 's/.*\(+\).*/\1/'
I would expect it to print 32768, it cuts off any character to the first digit, then gets all digits in 1, cuts off the rest after the digits, and should print 32768, instead it... (4 Replies)
Hi,
Am trying to replace a character '-' with 'O' in position 289 in my file but am not success with below command.
sed 's/^\(.\{289\}\)-/\1O/' filename
sed: 0602-404 Function s/^\(.\{289\}\)-/\1O/ cannot be parsed.
Thanks in Advance
Sara
Video tutorial on how to use code tags in The... (9 Replies)
Hi gang,
I am trying to create some batch commands for many html pages I need to re-format.
I am trying the number 2b in this example to wrap anchor tags around the number that will be referenced in the footnotes.
I am trying to use the h/H hold command, but I have never tried using it... (2 Replies)