Sponsored Content
Full Discussion: Grandpa returning to UNIX
Top Forums UNIX for Beginners Questions & Answers Grandpa returning to UNIX Post 303025863 by fossiili on Wednesday 14th of November 2018 03:58:48 AM
Old 11-14-2018
Oh no ... It was not the command cp the one I recollected. It must have been dd Smilie
 

10 More Discussions You Might Find Interesting

1. Programming

Returning Strings from C program to Unix shell script

Hi, Iam calling a C program from a Unix shell script. The (C) program reads encrypted username/password from a text file , decrypts and returns the decrypted string. Is there any way i can return the decrypted string to Unix shell program. My shell script uses the output of the program to... (11 Replies)
Discussion started by: satguyz
11 Replies

2. UNIX for Advanced & Expert Users

pclose returning -1

Hi all, In my application i am trying to select some text & then give it to print. for this i am opening a stream using popen & then later closing using pclose. Now this is working fine in my environment (solaris) but the pclose function is failing at my clients m/c. Even though print is... (3 Replies)
Discussion started by: nimishm123
3 Replies

3. Programming

Returning Strings from C program to Unix shell script

Hi, I'm having a requirement where I need to call a C program from a shell script and return the value from the C program to shell script. I refered a thread in this forum. But using that command in the code, it is throwing an error clear_text_password=$(get_password) Error: bash:... (24 Replies)
Discussion started by: venkatesh_sasi
24 Replies

4. Shell Programming and Scripting

returning from a function

Hi all, I am very new to BASH shell programming. I need to return an integer from a function to the caller function. I did this: but it keeps giving me wrong return: Can someone help me out here, please? Thanks (2 Replies)
Discussion started by: alirezan
2 Replies

5. Red Hat

ps-eo returning wrong value

Hi Need some help, bit of a noobie here. This command work perfectly with unix. returns a value of 1 which is what i want. ps -eo user,comm |grep -v grep |grep -c /path to file When i run the same command on a linux server it returns a value of 0., something maybe wrong with the command.... (4 Replies)
Discussion started by: wneutt
4 Replies

6. Shell Programming and Scripting

how to capture oracle function returning 2 values in unix

i have an oracle function which returns two values, one is the error message if the function encounters anything and another one which returns a number i need to capture both and pass it on to unix shell script how to do it (2 Replies)
Discussion started by: trichyselva
2 Replies

7. Shell Programming and Scripting

Returning -ve value in a pattern

Dear Friends, I need your help once more. I want to write a simple select as follows select amount from books where sr=1234 However, if value of "Amount" is negative then it should print it as follows. "3000-" and not as "-3000" Can you help me in this? Waiting for reply Anu. (2 Replies)
Discussion started by: anushree.a
2 Replies

8. Shell Programming and Scripting

Control from UNIX script is not returning to the Parent program

Hi All, My program flow is as below Windows batch -- > Cygwin batch --> zsh script There are multiple Cygwin batch scripts that are called from Windows batch file . But when i am executing the first cygwin batch script the control goes to the zsh file and executes and stoping from... (1 Reply)
Discussion started by: Hypesslearner
1 Replies

9. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have a UNIX script which will prepare anonymous oracle pl/sql block in a temporary file in run time and passes this file to sqlplus as given below. cat > $v_Input_File 2>>$v_Log << EOF BEGIN EXECUTE IMMEDIATE 'ALTER SESSION FORCE PARALLEL DML PARALLEL 16'; EXECUTE... (1 Reply)
Discussion started by: vikas_trl
1 Replies

10. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have exactly same issue @vikas_trl had in following link: https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html I wonder if he or somebody else could find the issue's cause or the solution. Any help would... (4 Replies)
Discussion started by: RicardoQ
4 Replies
Config::Record(3pm)					User Contributed Perl Documentation				       Config::Record(3pm)

NAME
Config::Record - Configuration file access SYNOPSIS
use Config::Record; # Create an empty record & then load from file my $config = Config::Record->new(); $config->load("/etc/myapp.cfg"); # Create & load, then save to filename my $config = Config::Record->new(file => "/etc/myapp.cfg"); $config->save("/etc/myapp.cfg"); # Load / save from filehandle my $fh = IO::File->new("/etc/myapp.cfg"); my $config = Config::Record->new(file => $fh); $config->save($fh); # Get a config value, throw error if not found my $value = $config->get("foo"); # Get a config value, return 'eek' if not found my $value = $config->get("foo", "eek"); # Set a value $config->set("foobar", "wizz"); # Get a deep config value (ie nested hash) my $value = $config->get("foo/bar", "eek"); # Get first element of an array param my $value = $config->get("people/[0]/forename"); # Get the raw hash reference forming the record my $record = $config->record(); # Get a new config object rooted at a sub-hash my $config = $config->view("foo"); DESCRIPTION
This module provides an API for loading and saving of simple configuration file records. Entries in the configuration file are essentially key,value pairs, with the key and values separated by a single equals symbol. The "key" consists only of alphanumeric characters. There are three types of values, scalar values can contain anything except newlines. Trailing whitespace will be trimmed unless the value is surrounded in double quotes. eg foo = Wizz foo = "Wizz.... " Long lines can be split with a backslash character, without introducing newlines. Without double quotes, whitespace at beginning and end of lines will be trimmed eg foo = This is a long line of text foo = "This is a long " "line of text" Multi-line strings can be provided as 'HERE' documents, eg foo = <<EOF This is a multiple paragraph block of text with newlines preserved EOF Array values consist of a single right round bracket, following by one "value" per line, terminated by a single left round bracket. eg foo = ( Wizz "Wizz... " ) Hash values consist of a single right curly bracket, followed by one key,value pair per line, terminated by a single left curly bracket. eg foo = { one = Wizz two = "Wizz.... " } Arrays and hashes can be nested to arbitrary depth. EXAMPLE
name = Foo title = "Wizz bang wallop" eek = ( OOhh Aahhh Wizz ) people = ( { forename = John surnamne = Doe } { forename = Some surname = One } ) wizz = { foo = "Elk" ooh = "fds" } EXTRA PARSER FEATURES
The syntax described thus far is classed as the base feature set. By passing the "features" parameter when creating an instance of the "Config::Record" class, it is possible to turn on certain extra features QUOTED NON-ALPHANUMERIC KEYS The keys for configuration parameters are normally restricted to only contain the characters 'a-Z', '0-9', '_', '-' and '.'. Sometimes it is desirable to allow arbitrary characters for keys. If this capability is required then the "quotedkeys" parameter can be set. EXAMPLE name = Foo title = "Wizz bang wallop" " some parameter " = ( foo bar } "an embeded " quote" = bar "an embeded \ backslash" = wizz EXTERNAL INCLUDE FILES With large configuration files it can be desirable to split them into a number of smaller files. If this capability is required, then the "includes" feature can be requested. Each included file must follow the syntax rules already described. EXAMPLE In the main file name = Foo title = "Wizz bang wallop" foo = @include(somefile.cfg) And in somefile.cfg firstname = Joe lastname = Blogs Is equivalent to name = Foo title = "Wizz bang wallop" foo = { firstname = Joe lastname = Blogs } METHODS
my $config = Config::Record->new([file => $file], [features => \%features]); Creates a new config object, loading parameters from the file specified by the "file" parameter. The "file" parameter can either be a string representing a fully qualified filename, or a IO::Handle object. If the "file" parameter is a string, this filename will be saved and future calls to "load" or "save" are permitted to omit the filename. If the "file" parameter is not supplied then an empty configuration record is created. The "features" parameter allows extra parser features to be enabled. The two valid keys for the associated hash as "includes" and "quotedkeys" as described earlier in this document. $config->load([$file]); Loads and parses a configuration record. The "file" parameter can either be a string representing a fully qualified filename, or an IO::Handle object. The $file parameter may be omitted, if a filename was specified in the constructor, or in previous calls to "load" or "save". Prior to loading the record, the current contents of this configuration are cleared. $config->save([$file]); Saves the configuration record to a file. The "file" parameter can either be a string representing a fully qualified filename, or an IO::Handle object opened for writing. The $file parameter may be omitted, if a filename was specified in the constructor, or in previous calls to "load" or "save". my $value = $config->get($key[, $default]); Gets the value of a configuration parameter corresponding to the name "key". If there is no value in the record, then the optional "default" is returned. $config->set($key, $value); Sets the value of a configuration parameter corresponding to the name "key". $config->view($key) Return a new Config::Record object, rooted at the specified key. If the key doesn't resolve to a hash reference an error will be raised. my $record = $config->record(); Retrieves a hash reference for the entire configuration record. Currently this is the actual internal storage record, so changes will modify the configuration. In the next release this will be changed to be a deep clone of the internal storage record. BUGS
Config::Record has the following limitations o If you load and then save a configuration file all comments are removed & whitespace normalized. o Ordering of elements in hash ref are not preserved across load and save sequence These limitations may be fixed in a future release if there is demand from users... AUTHORS
Daniel Berrange <dan@berrange.com> COPYRIGHT
Copyright (C) 2000-2007 Daniel P. Berrange <dan@berrange.com> SEE ALSO
perl(1) perl v5.12.4 2011-10-12 Config::Record(3pm)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy