QShell And The Integrated File System

2y ago
30 Views
2 Downloads
3.48 MB
40 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Angela Sonnier
Transcription

Michigan iSeries TechnicalEducation ConferenceQShell and theIntegrated File SystemPresented byRyan Technology ResourcesMichael ht 20062006MichaelMichael RyanRyan

The Integrated File System What is a file system? The System i has a number of differentfile systemsQSYS.LIB file system uses libraries ascontainers for other objects Webopedia.com defines a file system as “Thesystem that an operating system or programuses to organize and keep track of files.”Database filesProgramsOutput queuesQSYS.LIB is a ‘flat’ file system Only one level deep

The Integrated File System Other System i file systems include: Root (‘/’ or ‘slash’)QNTC (Windows NT compatible)QDLS (Document Library System) file systemQOpenSys (open systems)QSYS.LIB (traditional library)QOPT (optical drive)QFileSvr.400 (iSeries-to-iSeries)UDFS (User Defined)NFS (Network)QNetWare (Novell NetWare)

The Integrated File System These different file systems are knowncollectively on the System i as the IntegratedFile System (IFS)Similar to file systems on Windows or Linuxsystems A hierarchical file system that’s composed ofdirectories, subdirectories and filesFiles may contain program information, datainformation or other informationNo specific object types

The Integrated File System File System CommandsCPYTOSTMF – Copy to Stream File CPYFRMSTMF – Copy from Stream File CPYTOIMPF – Copy to Import File CPYFRMIMPF – Copy from Import file CPY – Copy a Stream File SAV/RST – Save/Restore an IFS file

The Integrated File System Work with Link (WRKLNK) encompassesother IFS-based commandsWork with Object LinksDirectory. . . . :/Type options, press Enter.2 Edit3 Copy4 Remove5 Display11 Change current directory .OptObject RQSYS.LIBTypeDIRDIRDIRDIRDIRDIRDIRDIRDIR7 Rename8 Display attributesAttributeTextPRODSystem LibraryMore.

Root File System Most widely used file systemContains important directories such as: QIBM, which contains Client Access, MQ Series, theXML Toolkit and many other IBM productsAlo contains ‘UNIX’ like directories bin, dev, etc, home, tmp, usr, var Most user-defined and vendor directories residein rootNames in the root file system can be mixedcase, but the file system is not case sensitive

QOpenSys File System Similar to the root file systemwith one importantdifference – case sensitivity Supports very looong file names File names may be in mixed caseFile system is case sensitiveUp to 16 megabytes for the object name and alldirectory namesEach component (name) can up to 255 charactersIBM uses QOpenSys for C compiler,InfoPrint, HTTP servers

QNTC File System Consists of the NT servers (and associatedshares) in a networkUse WRKLNK ‘/QNTC/*’ to see a list of the NTservers in a network Each server can then be accessed to provide accessto the shared directories on that serverBuilding of the list of NT servers can be very slow,especially in a large network Set environment variable QZLC SERVERLIST to a value of‘1’ (ADDENVVAR ENVVAR(QZLC SERVERLIST)VALUE('1')) to cause OS/400 to produce faster lists

QNTC File System You must have the same userid and passwordon the System i as on the NT server to be ableto access the files on the shared directoriesNames in QNTC can be mixed case, but the filesystem is not case sensitiveFiles accessed through QNTC are actually onNT servers Most of the IFS commands (CPY*, etc.) may be usedQNTC can be a powerful file system if you need toaccess NT server data from your System i

QDLS File System‘Document Library System’ Used for folders Filenames must be in 8.3 format Not case sensitive, all file names areuppercased Slower than the other file systems Don’t use this file system

QSYS.LIB File System Traditional file system accessed through IFSSyntax when using IFS R The extensions (.LIB, .FILE, .MBR) are used toidentify the type of objects being accessedQSYS.LIB file system uppercases names, socase sensitivity is not supported

QSYS.LIB File System Can access traditional ile/myfile.mbr') Copies the myfile.txt file from the transfer directory onthe NTServer server to the physical fileMICHAEL/MYFILERMVDIR DIR('/qsys.lib/aplib.lib') Deleted library APLIB

QShell Different systems have a different ‘lookand feel’ System i is a different environment than aUNIX, Linux or Windows systemThe different environments can be calledshells Primarily a *NIX term Korn shell, the Bourne Again Shell (BASH), the Cshell and others

QShell System i has its own shell - QShell A command interpreter and environment that looksand feels like a *NIX shellThis is important for a few reasons Allows programmers and administrators from othersystems to use familiar tools on iSeriesAssists in the implementation of Java and C or C based systems (including environment variables)Enables easier manipulation and management ofIntegrated File System (IFS) based resources

QShell QShell is available on all iSeries systems(V4R3 and later) Optional part of the operating system May not be installed The QShell Interpreter is option 30 ofOS/4005722SS1 30OS/400 - QShell InterpreterUse GO LICPGM to determine if QShell isinstalled on your system

QShell Invocation Invoke the QShell interpreter with: Start QShell Interpreter (STRQSH) commandOr simply with the QSH commandBoth commands call the same commandprocessing programOne parameter (CMD) is available for the QSHcommand An optional command to be executed This is an optional parameter

QShell Invocation If QShell is invoked without specifying aparameter, a specific hierarchy is followed toexecute a command: QShell executes commands that are specified in theIFS file /etc/profile (if the file exists);QShell executes commands that are specified in theIFS file .profile in the users home directory (if the fileexists);QShell executes commands that are specified in thefile whose name is specified in the ENV environmentvariable

QShell Invocation If a command is not specified, any profilefiles are executed and the QShellcommand entry screen is displayedQSH Command Entry F3 ExitF6 Print F9 Retrieve F12 DisconnectF13 Clear F17 Top F18 Bottom F21 CL command entry

QShell Commands . – Execute a command in the local directory(slashdot ‘/.’)cat – Display a filecd – Change directorychmod – Change mode (file mode)chown – Change ownership (file)cp – Copy filesexport – Set a variable in the environmentfile – Identify type of filefind – Find a file on diskgrep – Search a file for specified stringkill – End a process

QShell Commands ls – List contents of a directory mkdir – Make a directorymv – Move (delete, rename) filespax – Portable archive interchange (tar files)pwd – Print working directory rm – Delete filesrmdir – Remove directorysystem – Run an OS/400 CL commandtail – Display the last part (tail) of a filetouch – Create an empty file

Grep Command Example Grep will find a string within a fileFirst, let’s examine the contents of a fileSyntax: cat file to display cat /iSeries/fileaNow is the time for all good men to come to theaid of their partyThe quick brown fox jumped over the lazy dogWherever you go, there you areA stitch in time saves nine

Grep Command Example I need to find every instance of the string ‘the’within the file. Here’s an example of using thegrep command:Syntax: grep search string file to search I’ll search file /iSeries/filea for the string ‘the’ grep the /iSeries/fileaNow is the time for all good men to come to the aid oftheir partyThe quick brown fox jumped over the lazy dogWherever you go, there you are grep found every instance of the string ‘the’,including in the word ‘there’ in the last line.

Piping Example A common *NIX technique is piping Sending the output of one command to the input ofanother In other words, using the information created by executinga command as the input stream to a different command For example, if I needed to identify every file in the /iSeriesdirectory that had the letter ‘a’ in the name, I could use thegrep command with piping I’ll pipe the output from the ls command (list contentsof a directory) to the grep command

Piping Example lsfileafilewithalongname ls grep afileafilewithalongnamefileb The pipe operator (“ ”) is used to pipe the output ofthe ls command (the names of the files in thedirectory) to the grep commandGrep examined each line in the input and found twofilenames that contained the letter ‘a’

Redirection Example Redirection is the technique of changing theinput to a command or output from a commandfrom the standard location (keyboard anddisplay respectively) to a different locationThis different location will in many cases be afile – not unlike using an OS/400 display (DSP*)command and sending the output to an outfileThe redirection operators include: “ ” to redirect output to a new file“ ” to append output to an existing file“ ” to receive input from a file

Redirection Example Here’s an example of redirecting the output ofthe find command into a file:find /iseries -name fileb myfilelist cat myfilelist/iseries/fileb The redirection operator (“ ”) is used to sendthe output of the find command (the location ofthe name I specified) to the file myfilelist Displaying the contents of myfilelist shows the outputproduced by find

Shell Scripts A shell script is similar to a Control Language(CL) program on an iSeries system Can accept input in the form of parameters passedto the scriptProcess informationProduce resultsShell scripts are often used for systemmanagement and job control activities, such ascontrolling a jobstream of programs.

Shell Script Example Controls jobs and produces output in multipledirectories:# Any line starting with a ‘#’ is acomment system “call michael/settlecl”cp /finoutdir/settfile /iSeries/testfilerm /finoutdir/settfileecho “Settlement file produced” /iSeries/msgfilereturn

Shell Script Example The first action in this shell script is to executethe system command In this case, the command is CALL, and I’mcalling a program in library MICHAEL calledSETTCL This command executes an OS/400 commandNote:Case is not importantThe next step is to copy (using cp) the filesettfile in directory /finoutdir to file testfile indirectory iSeries

Shell Script Example The file /finoutdir/settfile is deleted using the rmcommandA message is placed into file /iSeries/msgfileusing the echo command and a little redirectionThe last step is to return from the shell scriptback to where the script was called – anothershell script, the QSH command line, or theOS/400 command line if the shell script wasspecified as the CMD parameter on the QSHcommand

Shell Script Example Here is the result of executing this shell script: /michael/settshellCPCA082: Object copied. cat /iseries/msgfileSettlement file produced

Shell Script Example The MICHAEL/SETTLECL program is a simpleone – it simply copies a file from the traditionalfile system to the IFSPGMCPYTOSTMF ile.mbr') TOSTMF('/finoutdir/settfile')ENDPGM

Shell Script ExampleThe CPCA082 message in the QSHsession came from OS/400 indicating thefile was copied (using the CPYTOSTMFcommand) When I display the /iSeries/msgfile fileusing the cat command, you can see themessage that was placed in that file withthe echo command

Shell Scripts You can create and edit shell scripts stored inthe IFS in a couple of different ways: Editing them using traditional Source Entry Utilityand then moving them to the IFSUsing a client editor and a NetServer mapped driveto edit the scriptThe Edit File (EDTF) command EDTF enables you to edit IFS files as well as QSYS datafiles (internally described) and source physical files

QSH and the IFS QSH can be used for tasks that interact with theIntegrated File System You can also use WRKLNK or iSeries NavigatorInvoke QSH and use the file and directorycommandsFor instance, I’ll use the mkdir and rmdir from aQSH command rather than using the samecommands from an OS/400 command line The reason is simple – I don’t have to be concernedabout quoting the argument to the command

QSH and the IFS Here’s what I mean: if I want to create a newIFS directory and I’m currently using theOS/400 command line, I would need to do this:mkdir ‘/michael/newdir’ The problem is that I will usually do this, at leastthe first time:mkdir /michael/newdir

QSH and the IFSAnd the problem is? I’ll get the message “/ not in expressionenclosed in parentheses” However, if I invoke QSH, I don’t need toworry about quoting That can reduce frustration is you do a lotof IFS work

QSH and the IFS There are over 30 different file and directoryoriented commands available within QSH,including commands to: Create, modify and delete files and directoriesWork with file and directory ownership andauthorizationDisplay filesArchive filesOther functions

Getting More Information The Information Center 5r3/index.jsp?topic /rzahz/intro.htmSeveral Redbooks that discuss QShell as partof another productQShell for iSeries by Ted Holt

The Integrated File System What is a file system? Webopedia.com defines a file system as “The system that an operating system or program uses to organize and keep track of files.” The System i has a number of different file systems QSYS.LIB file system uses libraries as container

Related Documents:

Silat is a combative art of self-defense and survival rooted from Matay archipelago. It was traced at thé early of Langkasuka Kingdom (2nd century CE) till thé reign of Melaka (Malaysia) Sultanate era (13th century). Silat has now evolved to become part of social culture and tradition with thé appearance of a fine physical and spiritual .

May 02, 2018 · D. Program Evaluation ͟The organization has provided a description of the framework for how each program will be evaluated. The framework should include all the elements below: ͟The evaluation methods are cost-effective for the organization ͟Quantitative and qualitative data is being collected (at Basics tier, data collection must have begun)

̶The leading indicator of employee engagement is based on the quality of the relationship between employee and supervisor Empower your managers! ̶Help them understand the impact on the organization ̶Share important changes, plan options, tasks, and deadlines ̶Provide key messages and talking points ̶Prepare them to answer employee questions

Dr. Sunita Bharatwal** Dr. Pawan Garga*** Abstract Customer satisfaction is derived from thè functionalities and values, a product or Service can provide. The current study aims to segregate thè dimensions of ordine Service quality and gather insights on its impact on web shopping. The trends of purchases have

On an exceptional basis, Member States may request UNESCO to provide thé candidates with access to thé platform so they can complète thé form by themselves. Thèse requests must be addressed to esd rize unesco. or by 15 A ril 2021 UNESCO will provide thé nomineewith accessto thé platform via their émail address.

Chính Văn.- Còn đức Thế tôn thì tuệ giác cực kỳ trong sạch 8: hiện hành bất nhị 9, đạt đến vô tướng 10, đứng vào chỗ đứng của các đức Thế tôn 11, thể hiện tính bình đẳng của các Ngài, đến chỗ không còn chướng ngại 12, giáo pháp không thể khuynh đảo, tâm thức không bị cản trở, cái được

Food outlets which focused on food quality, Service quality, environment and price factors, are thè valuable factors for food outlets to increase thè satisfaction level of customers and it will create a positive impact through word ofmouth. Keyword : Customer satisfaction, food quality, Service quality, physical environment off ood outlets .

EMC compliance temperature range durability automotive components Performance perception range field of view resolution accuracy frame rate Development Process requirement engineering project management SOTIF functional safety respect deadlines pre processing noise suppression free space dynamic objects static objects road markings range estimation interference suppression heating & cleaning .