Sponsored Content
Top Forums Shell Programming and Scripting ksh :: want to cut the strings Post 302227387 by rollthecoin on Thursday 21st of August 2008 06:02:13 AM
Old 08-21-2008
I am not getting the values in $1 and $2.

Is there any other way to follow this?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh - strings

Hi, I want to assign a string to a variable as below a="test " and use 'a' in grep grep $a .. when i tried this it was not taking the blank character in string a. how can represent blank space or blank character please help me thanks venkat (1 Reply)
Discussion started by: itzcoolbuddy
1 Replies

2. Shell Programming and Scripting

mailx: concatenating strings for message body (KSH)

Hi all, Think this is a pretty simple problem, but I've been thinking about it for a few days. Let's say that I'm going to have to output the contents of a file as the body of a mailx message. I'll probably do this: cat <filename> | mailx <extra commands> However, how do I go about doing... (1 Reply)
Discussion started by: rockysfr
1 Replies

3. Shell Programming and Scripting

Need to cut filename in LINUX ksh

Hi, I need to cut filename in Linux ksh. for example file name is c_xxxx_cp_200908175035.zip. I need to get variable with only c_xxxx_cp value. (10 Replies)
Discussion started by: juliyp
10 Replies

4. Shell Programming and Scripting

ksh + isql => output cut at 2 GB

Using a ksh script, I'm dumping the data from our sybase database into an output file. This output file is for what ever reason cut at 2GB. There is enough space on the unix machine and as there is no error message is received I have no clue to start looking for a solution. #!... (1 Reply)
Discussion started by: bereman
1 Replies

5. Shell Programming and Scripting

ksh cut out words from string

Hi, I have: export string1=qwerWhatever export string2=qwerWhatever1 export currdir=`pwd` echo $currdir gives back: /dir/dir/Whatever1 I want to take first 4 letters from string1 (in this case: qwer), compare it to string2 (in this case qwerWhatever1) and if string2 has in it... (8 Replies)
Discussion started by: chish
8 Replies

6. Shell Programming and Scripting

How to preserve space while concatenating strings? (KSH)

I have these str1=$(echo "This is string one with spaces \n This is also my sentence 1") When I echo $str1, it displays the new line character properly. Now I have another new variable say str2. I want to concatenate in this way.. str1 + newline character + and then str2. That's I... (3 Replies)
Discussion started by: dahlia84
3 Replies

7. Shell Programming and Scripting

KSH Script to watch log files for 2 strings

Hi all, How can I do a ksh script to watch a log file for 2 specific alarms that have one this string : "Connection Error" and the other one: "Failure in sending". I would like to watch for these two alarms in the log and then if each of them repeats for about 30 times to go kill 2 processes. ... (1 Reply)
Discussion started by: Pouchie1
1 Replies

8. Shell Programming and Scripting

ksh: how to extract strings from each line based on a condition

Hi , I'm a newbie.Never worked on Unix before. I want a shell script to perform the following: I want to extract strings from each line ,based on the type of line(Nameline,Subline) and output it to another file.Below is a sample format. 2010-12-21 14:00"1"Nameline"Midterm"First Name:Jane ... (4 Replies)
Discussion started by: angie1234
4 Replies

9. Shell Programming and Scripting

Cut the strings from end

could you please help me. I have below autosys jobs 01_enable_input_hol_dtpz1b 01_abc_copy_ld_sat_xxxz1 01_abc_mavcd_yyyyyxxxz1 01_abcdef_oa_xxxxxz1 01_fdgte_symbol_ddddz1 01_fsdfsd_clean_mmmhhhfz1 01_fsdfd_create_mut_marchtz1 I want to remove name after last "_" underscore so that... (6 Replies)
Discussion started by: sdosanjh
6 Replies

10. UNIX for Advanced & Expert Users

Cut a word between two strings and repeat the same in the entire file

in the below data i need to search for the word typeMismatch and then traverse back to find the filename of that particular mismatch. Like this we have to get all the file names which has error in them. How can i acheive this. I tried use sed or awk but not able to achevie the same. Sample... (2 Replies)
Discussion started by: ATWC
2 Replies
GETFATTR(1)							  File Utilities						       GETFATTR(1)

NAME
getfattr - get extended attributes of filesystem objects SYNOPSIS
getfattr [-hRLP] -n name [-e en] pathname... getfattr [-hRLP] -d [-e en] [-m pattern] pathname... DESCRIPTION
For each file, getfattr displays the file name, and the set of extended attribute names (and optionally values) which are associated with that file. The output format of getfattr -d is as follows: 1: # file: somedir/ 2: user.name0="value0" 3: user.name1="value1" 4: user.name2="value2" 5: ... Line 1 identifies the file name for which the following lines are being reported. The remaining lines (lines 2 to 4 above) show the name and value pairs associated with the specified file. OPTIONS -n name, --name=name Dump the value of the named extended attribute extended attribute. -d, --dump Dump the values of all extended attributes associated with pathname. -e en, --encoding=en Encode values after retrieving them. Valid values of en are "text", "hex", and "base64". Values encoded as text strings are enclosed in double quotes ("), while strings encoded as hexidecimal and base64 are prefixed with 0x and 0s, respectively. -h, --no-dereference Do not follow symlinks. If pathname is a symbolic link, the symbolic link itself is examined, rather than the file the link refers to. -m pattern, --match=pattern Only include attributes with names matching the regular expression pattern. The default value for pattern is "^user\.", -m which includes all the attributes in the user namespace. Refer to attr(5) for a more detailed discussion on namespaces. --absolute-names Do not strip leading slash characters ('/'). The default behaviour is to strip leading slash characters. --only-values Dump out the extended attribute value(s) only. -R, --recursive List the attributes of all files and directories recursively. -L, --logical Logical walk, follow symbolic links. The default behaviour is to follow symbolic link arguments, and to skip symbolic links encoun- tered in subdirectories. -P, --physical Physical walk, skip all symbolic links. This also skips symbolic link arguments. --version Print the version of getfattr and exit. --help Print help explaining the command line options. -- End of command line options. All remaining parameters are interpreted as file names, even if they start with a dash character. AUTHOR
Andreas Gruenbacher, <a.gruenbacher@computer.org> and the SGI XFS development team, <linux-xfs@oss.sgi.com>. Please send your bug reports or comments to these addresses. SEE ALSO
setfattr(1), and attr(5). Dec 2001 Extended Attributes GETFATTR(1)
All times are GMT -4. The time now is 10:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy