Sponsored Content
Full Discussion: My Exam Question
Top Forums Shell Programming and Scripting My Exam Question Post 302990668 by Darthy on Monday 30th of January 2017 12:23:05 PM
Old 01-30-2017
My Exam Question

Hello My friends,

This is my new Thread and i am so newbie about Bash/shell code.

My first exam question is : there is a file (name is also File) and this file has 2 letters and 1 number. And number is in the middle. like this
a
2
c

I have to show only number on screen. And i did like this :

Code:
cat file | tail -n1 | head -n2

and i can see on my screen "2"

the next question is (it continues) : I have to SUM this number with shell code

and i created new kate file and name is total and wrote there :

Code:
c = cat file | tail -n1 | head -n2 

echo $total `expr $c + $c`

but i get "expr :syntax error" ?

How can i sum this number ?

thanks for your helps. Hope so i could explain myself.
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HELP for Simple exam

Can you help me to know the commands for these problems? 1. Count the no. of users that are currently logged into the system. 2. Count the no. of lines in /etc/passwd that contains the pattern home. 3. Modify Question #2 so that you save all entries from /etc/passwd that contain the... (1 Reply)
Discussion started by: mhos_mhos
1 Replies

2. UNIX for Advanced & Expert Users

HP-UX CSA Exam

Hey All, I have bought some paper from the net... let's say in PDF format. They are some questions from that paper that says Explanation: pending. Send your suggestion tofeedback*****king.com ... anyway. Here are the questions. I have made my choice but would like to know your opinion. 1. The... (1 Reply)
Discussion started by: qfwfq
1 Replies

3. Solaris

Question about exam

Hello guys I hope you well and in great health, i wonder if i want to get Solaris 11 (1z0-821) exam i've to talk a course in oracle or i can just register for the exam and take it. thanks. (1 Reply)
Discussion started by: mohamed91
1 Replies

4. Solaris

New User Login Exam Question

Hi Folks, I am studying for my 1z0-821 exam and I would like to clarify an answer to the following question : You have a ticket from a new user on the system, indicating that he cannot log in to his account. The information in the ticket gives you both the username and password. The ticket... (2 Replies)
Discussion started by: Ravneet_Pal
2 Replies
Locale::Script(3perl)					 Perl Programmers Reference Guide				     Locale::Script(3perl)

NAME
Locale::Script - standard codes for script identification SYNOPSIS
use Locale::Script; $script = code2script('phnx'); # 'Phoenician' $code = script2code('Phoenician'); # 'Phnx' $code = script2code('Phoenician', LOCALE_CODE_NUMERIC); # 115 @codes = all_script_codes(); @scripts = all_script_names(); DESCRIPTION
The "Locale::Script" module provides access to standards codes used for identifying scripts, such as those defined in ISO 15924. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 15924 four-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying scripts. The ones currently supported are: alpha This is a set of four-letter (capitalized) codes from ISO 15924 such as 'Phnx' for Phoenician. This code set is identified with the symbol "LOCALE_SCRIPT_ALPHA". The Zxxx, Zyyy, and Zzzz codes are not used. This is the default code set. numeric This is a set of three-digit numeric codes from ISO 15924 such as 115 for Phoenician. This code set is identified with the symbol "LOCALE_SCRIPT_NUMERIC". ROUTINES
code2script ( CODE [,CODESET] ) script2code ( NAME [,CODESET] ) script_code2code ( CODE ,CODESET ,CODESET2 ) all_script_codes ( [CODESET] ) all_script_names ( [CODESET] ) Locale::Script::rename_script ( CODE ,NEW_NAME [,CODESET] ) Locale::Script::add_script ( CODE ,NAME [,CODESET] ) Locale::Script::delete_script ( CODE [,CODESET] ) Locale::Script::add_script_alias ( NAME ,NEW_NAME ) Locale::Script::delete_script_alias ( NAME ) Locale::Script::rename_script_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::add_script_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::delete_script_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes man page. SEE ALSO
Locale::Codes Locale::Constants http://www.unicode.org/iso15924/ Home page for ISO 15924. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2011 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-09-26 Locale::Script(3perl)
All times are GMT -4. The time now is 07:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy