Sponsored Content
Full Discussion: Peculiar behavior due to IFS
Operating Systems Linux Peculiar behavior due to IFS Post 302778387 by ravisingh on Sunday 10th of March 2013 10:26:17 PM
Old 03-10-2013
Thanks Alister and Scrutinizer for the basics!
 

10 More Discussions You Might Find Interesting

1. Linux

SUSE9.1 Peculiar Gigabit Lan performance.

I'm having some peculiar performance issues with my Gigabit Lan. I have some 100Mb devices so I can't do the necessary "jumbo Frame" tweaks for absolute optimum performance as I'd prevent them access. I'm getting appauling transfer rates sending files to the linux machine, around 10 Mbps 3%... (0 Replies)
Discussion started by: Mark Ward
0 Replies

2. Shell Programming and Scripting

a peculiar error with sftp

Whenever I sftped a particular gzipped file to a particular directory and then try to unzip it, I get Permission Denied error. With this file even I cannot do chmod. though the file permissions are -rw-r--r-- When same file I sftp to a different location I am able to gunzip it. Directory... (0 Replies)
Discussion started by: RishiPahuja
0 Replies

3. UNIX for Dummies Questions & Answers

the IFS variable

Hi all, Ok os heres my situation. I have created a database style program that stores a persons info (name,address,phone number etc.) in a file ("database"). after i read in all the values above, i assign them to a line variable: line="$name^$address^$phonenum" >> phonebuk as you can see... (1 Reply)
Discussion started by: djt0506
1 Replies

4. Shell Programming and Scripting

problem with IFS

hi, :) I set IFS=":" But when i try to echo $IFS,i am not getting any thing on the screen escept a blank line. any help pls. cheers RRK (11 Replies)
Discussion started by: ravi raj kumar
11 Replies

5. UNIX for Dummies Questions & Answers

Help on IFS command!

Hi! I am working in korn shell. I want to reset the dimiliter for the set command to "|" but instead of a command prompt return I am getting something as below After issuing the command I am getting this....as if the shell is expecting something else. Can anybody suggest what's the problem. ... (2 Replies)
Discussion started by: udiptya
2 Replies

6. Shell Programming and Scripting

regarding IFS=

hi i am a learner can some explain "export IFS=$(echo "\n\t\a")" i am not able to understand the functionality please help thanks Satya (1 Reply)
Discussion started by: Satyak
1 Replies

7. AIX

Peculiar permission problem

Scenario: Step 1. I'm logging into AIX server using user id called user1 Step 2. I'm traversing to home directory of user2 Note: This user2's home directory has the permissions drwxr-s--- Step 3. I'm issuing command pwd there. I'm getting the expected output. Step 4. I'm issuing the... (3 Replies)
Discussion started by: krishmaths
3 Replies

8. Shell Programming and Scripting

Nested ifs

hi I keep getting an error with this nested if statement and am getting the error unexpected end of file, can anyone help me as to why this wont execute? #!/bin/bash #script to check wether the -i -v statements run correctly removeFile () { mv $1 $HOME/deleted }... (3 Replies)
Discussion started by: somersetdan
3 Replies

9. Shell Programming and Scripting

Bash IFS

I am using bash and resetting IFS as below when reading the command line arguments. I do this so I can call my script as in Ex1. Ex1: ./synt2d-ray3dmod.bash --xsrc=12/20/30 This allows me to split both sides so that when I do "shift" I can get 12/20/30 What I do not understand is... (21 Replies)
Discussion started by: kristinu
21 Replies

10. Shell Programming and Scripting

Not able to understand IFS

Hi , i am in my initial learning phase of unix. i was going thru the function part. below is the example which was there but i am not able to understand logic and the use of IFS(internal field separator) lspath() { OLDIFS="$IFS" IFS=: for DIR in $PATH ; do echo $DIR ; done IFS="$OLDIFS"... (8 Replies)
Discussion started by: scriptor
8 Replies
DBIx::Class::Manual::QuickStart(3)			User Contributed Perl Documentation			DBIx::Class::Manual::QuickStart(3)

NAME
DBIx::Class::Manual::QuickStart - up and running with DBIC in 10 minutes DESCRIPTION
This document shows the minimum amount of code to make you a productive DBIC user. It requires you to be familiar with just the basics of database programming (what database tables, rows and columns are) and the basics of Perl object-oriented programming (calling methods on an object instance). It also helps if you already know a bit of SQL and how to connect to a database through DBI. Follow along with the example database shipping with this distribution, see directory examples/Schema. This database is also used through- out the rest of the documentation. Preparation First, install DBIx::Class like you do with any other CPAN distribution. See <http://www.cpan.org/modules/INSTALL.html> and perlmodinstall. Then open the distribution in your shell and change to the subdirectory mentioned earlier, the next command will download and unpack it: $ perl -mCPAN -e'CPAN::Shell->look("DBIx::Class")' DBIx-Class$ cd examples/Schema Inspect the database: DBIx-Class/examples/Schema$ sqlite3 db/example.db .dump You can also use a GUI database browser such as SQLite Manager <https://addons.mozilla.org/firefox/addon/sqlite-manager>. Have a look at the schema classes files in the subdirectory MyApp. The "MyApp::Schema" class is the entry point for loading the other classes and interacting with the database through DBIC and the "Result" classes correspond to the tables in the database. DBIx::Class::Manual::Example shows how to write all that Perl code. That is almost never necessary, though. Instead use dbicdump (part of the distribution DBIx::Class::Schema::Loader) to automatically create schema classes files from an existing database. The chapter "Resetting the database" below shows an example invocation. Connecting to the database A schema object represents the database. use MyApp::Schema qw(); my $schema = MyApp::Schema->connect('dbi:SQLite:db/example.db'); The first four arguments are the same as for "connect" in DBI. Working with data Almost all actions go through a resultset object. Adding data Via intermediate result objects: my $artist_ma = $schema->resultset('Artist')->create({ name => 'Massive Attack', }); my $cd_mezz = $artist_ma->create_related(cds => { title => 'Mezzanine', }); for ('Angel', 'Teardrop') { $cd_mezz->create_related(tracks => { title => $_ }); } Via relation accessors: $schema->resultset('Artist')->create({ name => 'Metallica', cds => [ { title => q{Kill 'Em All}, tracks => [ { title => 'Jump in the Fire' }, { title => 'Whiplash' }, ], }, { title => 'ReLoad', tracks => [ { title => 'The Memory Remains' }, { title => 'The Unforgiven II' }, { title => 'Fuel' }, ], }, ], }); Columns that are not named are filled with default values. The value "undef" acts as a "NULL" in the database. See the chapter "Introspecting the schema classes" below to find out where the non-obvious source name strings such as "Artist" and accessors such as "cds" and "tracks" come from. Set the environment variable "DBI_TRACE='1|SQL'" to see the generated queries. Retrieving data Set up a condition. my $artists_starting_with_m = $schema->resultset('Artist')->search( { name => { like => 'M%' } } ); Iterate over result objects of class "MyApp::Schema::Result::Artist". Result objects represent a row and automatically get accessors for their column names. for my $artist ($artists_starting_with_m->all) { say $artist->name; } Changing data Change the release year of all CDs titled ReLoad. $schema->resultset('Cd')->search( { title => 'ReLoad', } )->update_all( { year => 1997, } ); Removing data Removes all tracks titled Fuel regardless of which CD the belong to. $schema->resultset('Track')->search( { title => 'Fuel', } )->delete_all; Introspecting the schema classes This is useful for getting a feel for the naming of things in a REPL or during explorative programming. From the root to the details: $schema->sources; # returns qw(Cd Track Artist) $schema->source('Cd')->columns; # returns qw(cdid artist title year) $schema->source('Cd')->relationships; # returns qw(artist tracks) From a detail to the root: $some_result->result_source; # returns appropriate source $some_resultset->result_source; $some_resultsource->schema; # returns appropriate schema Resetting the database # delete database file DBIx-Class/examples/Schema$ rm -f db/example.db # create database and set up tables from definition DBIx-Class/examples/Schema$ sqlite3 db/example.db < db/example.sql # fill them with data DBIx-Class/examples/Schema$ perl ./insertdb.pl # delete the schema classes files DBIx-Class/examples/Schema$ rm -rf MyApp # recreate schema classes files from database file DBIx-Class/examples/Schema$ dbicdump -o dump_directory=. MyApp::Schema dbi:SQLite:db/example.db Where to go next If you want to exercise what you learned with a more complicated schema, load Northwind <http://code.google.com/p/northwindextended/> into your database. If you want to transfer your existing SQL knowledge, read DBIx::Class::Manual::SQLHackers. Continue with DBIx::Class::Tutorial and "WHERE TO START READING" in DBIx::Class. perl v5.18.2 2014-01-05 DBIx::Class::Manual::QuickStart(3)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy