Sponsored Content
Full Discussion: Unable to swap values
Top Forums Shell Programming and Scripting Unable to swap values Post 302907803 by Chubler_XL on Tuesday 1st of July 2014 11:18:43 PM
Old 07-02-2014
You could be deceiving yourself with the first echo statement which is printing your current directory using the pwd executable not the value of $pwd

Remember to use [code] and [/code] tags around your posted code to keep the format nice:

Code:
#!/bin/bash
pwd=`cat 1.ini | grep -w PWD | cut -d'=' -f2` 
echo "the value is $pwd"

pwd2=`cat 2.ini | grep -w PWD | cut -d'=' -f2` 
echo "the value of pwd2 is $pwd2"

if [[ "$pwd" == "$pwd2" ]]
then
  echo both are same
else
  temp_pwd=$pwd2
  pwd2=$pwd
  pwd=$temp_pwd

  echo ------------------
  echo the value is pwd is $pwd
  echo the value is pwd2 is $pwd2
  echo the value is temp_pwd is $temp_pwd
fi

 

10 More Discussions You Might Find Interesting

1. Solaris

Swap config - Mirror swap or not?

Hello and thanks in advance. I have a Sun box with raid 1 on the O/S disks using solaris svm. I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space. I have been warned not to do this by some... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

2. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

3. Red Hat

swap not defined as swap

free -m : 1023 total swap space created default partition /dev/sdb1 50M using fdisk. i did write the changes. #mkswap /dev/sdb1 #swapon /dev/sdb1 free -m : 1078 total swap space this shows that the swap is on Question : i did not change the type LINUX SWAP (82) in fdisk. so why is... (5 Replies)
Discussion started by: dplinux
5 Replies

4. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

5. Shell Programming and Scripting

unable to return multilple values in perl

hello friends, i have written one perl script.Which opens a file and search for some parameter's value and gets the status of these parameters. but while i am trying to return these value always i am getting false. Can any one please help me.. here is that function: =======================... (5 Replies)
Discussion started by: harpal singh
5 Replies

6. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

7. Shell Programming and Scripting

Converting odd values to even values(or vice-versa) located in a column

Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Unable to read assign values to two variables in while loop

I am trying to read a input file which has two columns separated by space Input file server1 server2 server3 server4 server5 server6 When i execute the below while code it reads line by line and a and b variables are able to successfully fetch the values while read a b do echo "$a" echo... (5 Replies)
Discussion started by: chidori
5 Replies

9. Solaris

Explain the output of swap -s and swap -l

Hi Solaris Folks :), I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands. $swap -s total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available $swap -l swapfile dev swaplo... (6 Replies)
Discussion started by: seenuvasan1985
6 Replies

10. Shell Programming and Scripting

How to swap the values in array using for loop?

array=( 8 5 6 2 3 4 7 1 9 0 ) for i in "${array}" do echo $i done # i need the output like this by swapping of array values 0 9 1 7 4 3 2 6 5 8 (7 Replies)
Discussion started by: Meeran Rizvi
7 Replies
xrdp(8) 																   xrdp(8)

NAME
xrdp - a Remote Desktop Protocol (RDP) server SYNTAX
xrdp [ --nodaemon | --kill | --help ] DESCRIPTION
xrdp is a Remote Desktop Protocol (RDP) Server. Unlike Windows NT/2000/2003 server, xrdp will not display a Windows desktop but an X window desktop to the user. It can also be used as a VNC->RDP bridge. OPTIONS
-n, --nodaemon Starts xrdp in foreground instead of starting it as a daemon. -k, --kill Kills running xrdp daemon. -h, --help Output help information and exit. FILES
${XRDP_BIN_DIR}/xrdp ${XRDP_CFG_DIR}/xrdp.ini ${XRDP_LOG_DIR}/xrdp.log ${XRDP_PID_DIR}/xrdp.pid AUTHORS
Jay Sorg <jsorg71@users.sourceforge.net> Simone Fedele <ilsimo@users.sourceforge.net> SEE ALSO
xrdp.ini(5) sesman(8) sesman.ini(5) sesrun(8) for more info on xrdp see http://xrdp.sf.net xrdp team 0.1.0 xrdp(8)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy