Sponsored Content
Top Forums Shell Programming and Scripting how to get rid of ' from variable? Post 302382942 by TonyFullerMalv on Sunday 27th of December 2009 10:23:41 AM
Old 12-27-2009
Question is not very clear but here is what I think you are after:
Code:
$ AJF=\'fred\'; export AJF
$ env | grep AJF
AJF='fred'

We have a variable whose value includes the ' character.

To extract the value from the above do:
Code:
$ echo $AJF | awk -F"'" '{ print $2 }'
fred
$

To put the extracted value into a new variable do:
Code:
$ BHG=`echo $AJF | awk -F"'" '{ print $2 }'`
echo $BHG
fred
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to get rid of DCHP

Hi all:- I am using Sun8 Intel PC in a network and have IP allocated by DHCP. Now I got a static IP and want to configure my PC for this new IP and disable DHCP. How can I do that ? Thanks in advance (6 Replies)
Discussion started by: s_aamir
6 Replies

2. IP Networking

How to get rid of DCHP ?

Hi all:- I am using Sun8 Intel PC in a network and have IP allocated by DHCP. Now I got a static IP and want to configure my PC for this new IP and disable DHCP. How can I do that ? Thanks in advance (3 Replies)
Discussion started by: s_aamir
3 Replies

3. Solaris

getting rid of ^H

Hello everybody I have a very annoying problem on my Solaris (Unix in general) servers. When I open a shell and press the backspace button, it results in a ^H character being printed on screen. I can resolve it by typing stty erase <backspace>, but does anyone know how I can prevent the... (3 Replies)
Discussion started by: soliberus
3 Replies

4. Debian

Getting rid of grub

ok so i have two HDs on my PC, on the 1st one (master) i have w2k running, i decided to install debian on the second (slave). During the install, i was asked if i wanted to install grub, i said yes. Now debian starts just fine. Windows on the hand now takes forever to load (ie like two minutes... (4 Replies)
Discussion started by: jad
4 Replies

5. Solaris

how to get rid of ok prompt

Hi: My ultra 10 booted up to the ok prompt. does anyone how to get to the # prompt in normal mode? Alan (1 Reply)
Discussion started by: alanj9000
1 Replies

6. UNIX for Dummies Questions & Answers

how to get rid of ==>

ok the assignment question: That English paper you were writing on the works of Lewis Carroll is due in a few hours and you have forgeotten the name of the text file in which you has written a number of quotations to use in your paper. Luckily, you know that the file is somewhere in your... (1 Reply)
Discussion started by: mek86
1 Replies

7. Shell Programming and Scripting

how to get rid of ^M in the file

Hi I have a file wich contains ^M characters, looks like these are from DOS, Is there a way to get rid of them? Thanks -A (3 Replies)
Discussion started by: aoussenko
3 Replies

8. UNIX for Dummies Questions & Answers

How to get rid of ^[[D

Hi All, Im selecting a large record from a table and putting it in a file in the unix box. The file has a hidden character "^[[D " present in it. Can any one help me in getting rid of the character Thanks in advance, (4 Replies)
Discussion started by: madhan@29
4 Replies

9. Linux

How to get rid of ^m

Hi all, I am new to unix....pls help me with this. I have a binary file generating output by passing arguments in bash.when i open the output file in VI i can see that ^m is included in between most of lines,as a result when i pass this file to my java application it dosent parse the data... (3 Replies)
Discussion started by: asheshrocky
3 Replies

10. Shell Programming and Scripting

Getting rid of ^M

I have a text file with hundreds of 32-character hash codes in it, each terminated with a linefeed (/l, or ^M). 185ead08e45a5cbb51e9f7b0b384aaa2 57643e1a17252a9fc746d49c3da04168 60cba11d09221d52aaabb5db30f408a2 2b75ee6e5c2efc31b4ee9a190d09a4df ...... etc. I want to create a file for each... (6 Replies)
Discussion started by: teledon
6 Replies
vf_get_prop_value_string(3)				     Library Functions Manual				       vf_get_prop_value_string(3)

NAME
vf_get_prop_value_string - vf_get_prop_value_string() SYNOPSIS
#include <../vformat/vf_iface.h> extern char *vf_get_prop_value_string ( VF_PROP_T *p_prop, uint32_t n_string ); PARAMETERS
VF_PROP_T *p_prop Property to locate string from. uint32_t n_string Index to string required. DESCRIPTION
Obtain string pointer value from VF_PROP_T. For example a property may be defined as: THING;THIS=STUFF;WITH-QUALIFIERS:fred-fred-fred;gogogo;baabaabaa A call to vf_get_prop_value_string() specifying n_string=1 will return a pointer to the gogogo value. Return NULL if out of range request, ie. N_string=3 for N:0;1;2. RETURNS
Pointer to string value if value present, NULL if index too large. SEE ALSO
vf_parse_init(3), vf_parse_text(3), vf_parse_end(3), vf_read_file(3), vf_write_file(3), vf_get_next_object(3), vf_create_object(3), vf_get_object_type(3), vf_get_property(3), vf_get_property_ex(3), vf_get_next_property(3), vf_get_prop_value(3), vf_set_prop_value(3), vf_get_prop_name_string(3), vf_set_prop_name_string(3), vf_get_prop_name(3), vf_get_prop_value_object(3), vf_set_prop_value_object(3), vf_set_prop_value_string(3), vf_set_prop_value_base64(3), vf_get_prop_value_base64(3), vf_set_property_from_file(3), vf_delete_object(3), vf_delete_prop(3), vf_find_prop_qual_index(3), vf_is_modified(3), vf_find_charset(3), vf_date_string_to_time(3), vf_period_string_to_time(3), vf_period_time_to_string(3), vf_set_prop_value_time(3), vf_get_prop_value_time(3) c2man vf_iface.h 30 April 2003 vf_get_prop_value_string(3)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy