Sponsored Content
Top Forums Shell Programming and Scripting ::select statement return value with correct field size:: Post 302309441 by devtakh on Wednesday 22nd of April 2009 12:09:37 AM
Old 04-22-2009
what is it you are getting now:

a typo in the lasr post, it is

local_ID=$(echo $data_type_SQL | awk -F "|" '{print substr($4,1,6)}')

this variables will give you the output with the spaces...



cheers,
Devaraj Takhellambam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error : Field $() is not correct

Hi All, I'm new to shell scripting. Trying to extract substring using awk script as shown below : Flag=$1 Length=`echo ${#Flag}` NewLen=$Length-2 NewFlag=`echo $Flag|awk '{print substr($Flag,0,$NewLen)}'` echo "New string is : $NewFlag" exit When I execute this script the following... (3 Replies)
Discussion started by: abbey
3 Replies

2. UNIX and Linux Applications

Oracle Select IN statement

If I recall, when I used informix I could do a sql statement like: SELECT Value from Table WHERE ID in (100,200,300); How do I do this in Oracle? I believe I am using Oracle 10 if that matters. Thanks. (1 Reply)
Discussion started by: benefactr
1 Replies

3. Shell Programming and Scripting

How can i assign an select statement into a variable?

I am trying to assign an select statement into a variable. Can someone hel me with this. example : a='select * from dual' echo $a should give me select * from dual But this is not working. I trying with \ before * and quotes too. (1 Reply)
Discussion started by: rdhanek
1 Replies

4. Shell Programming and Scripting

Please help inserting the correct if-then-else statement

Hi All, I have this script below that checks rpm code version to Linux and Solaris servers. The script is run using arguement ($1) which is server_list.txt. It runs as: $ ./scriptname server_list.txt #!/bin/bash QUERY="/opt/rpm/bin/rpm -qa --queryformat '%{installtime}... (0 Replies)
Discussion started by: linuxgeek
0 Replies

5. Shell Programming and Scripting

Select variable within a if statement

i want to select a variable created and use it in a if statement, but not getting the desired results LINE='device for 0101a01: lpd://172.25.41.111:515' prt=`echo $LINE | awk '{print $3 }' | cut -c 1-7` echo $prt My if statement to select just what i want.. IFS=$":" while read prt... (11 Replies)
Discussion started by: ggoliath
11 Replies

6. UNIX for Dummies Questions & Answers

How to select correct partition and kernel argument for grub?

I use command-line mode of GRUB to load kernel, but I can not know how to chose the partition and kernel argument, as followed : please tell me how to do deal with , thanks! (0 Replies)
Discussion started by: cqlouis
0 Replies

7. Shell Programming and Scripting

if statement is not giving correct op

Hi I am using a awk command but not getting required o/p. input file a.txt 2 ak 3 cb 4 de 5 gh 6 ij awk program BEGIN { x=0 } {if ($1>3) {x=x+1}{print $0} } END { print "I found " x " line have value more than 3" } output 2 ak 3 cb 4 de 5 gh 6 ij (3 Replies)
Discussion started by: aaysa123
3 Replies

8. UNIX for Dummies Questions & Answers

Select Command - return

Hello everyone, A simple question which may have a suggested solution: I am using, and loving, the select command in a ksh93 script on AIX 6.1 to present users with menus. I have been successful in controlling all of key input by the users, I still have an issue with the RETURN key. When the... (4 Replies)
Discussion started by: gio001
4 Replies

9. Shell Programming and Scripting

Problem with select statement

Hi I have run out of ideas as to why this select doesn't work in a script I am writing. The script sources a file of common functions and I am trying to use a select statement within one of the functions - PS3="Try? " select X in CONT EXIT; do if ] ... (4 Replies)
Discussion started by: steadyonabix
4 Replies

10. Shell Programming and Scripting

Id command does not return correct username

On server1 the "id" command works fine and returns "myuser" user as was expected. Below are the details of the good server. $ id -nu 501 myuser $ cat /etc/system-release Red Hat Enterprise Linux Server release 7.6 (Maipo) $ uname -a Linux server1 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4... (10 Replies)
Discussion started by: mohtashims
10 Replies
spacing(3MENU)															    spacing(3MENU)

NAME
menu_spacing - Control spacing between menu items. SYNOPSIS
#include <menu.h> int set_menu_spacing(MENU *menu, int spc_description, int spc_rows, int spc_columns); int menu_spacing(const MENU *menu, int* spc_description, int* spc_rows, int* spc_columns); DESCRIPTION
The function set_menu_spacing sets the spacing information for the menu. Its parameter spc_description controls the number of spaces between an item name and an item description. It must not be larger than TABSIZE. The menu system puts in the middle of this spacing area the pad character. The remaining parts are filled with spaces. The spc_rows parameter controls the number of rows that are used for an item. It must not be larger than 3. The menu system inserts the blank lines between item rows, these lines will contain the pad character in the appropriate positions. The spc_columns parameter controls the number of blanks between columns of items. It must not be larger than TABSIZE. A value of 0 for all the spacing values resets them to the default, which is 1 for all of them. The function menu_spacing passes back the spacing info for the menu. If a pointer is NULL, this specific info is simply not returned. RETURN VALUE
Both routines return E_OK on success. set_menu_spacing may return E_POSTED if the menu is posted, or E_BAD_ARGUMENT if one of the spacing values is out of range. SEE ALSO
ncurses(3NCURSES), curses_variables(3NCURSES), menu(3MENU). NOTES
The header file <menu.h> automatically includes the header file <curses.h>. PORTABILITY
These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. spacing(3MENU)
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy