08-25-2010
Where's the fire?
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.
For members who want a higher visibility to their questions, we suggest you post in the
Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.
Posting a new question in the
Emergency UNIX and Linux Support Forum requires forum
Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.
If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.
Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.
Thank you.
The UNIX and Linux Forums
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i have a simple question:
in hpux 11i;
this cmd :
cat mailtest |grep sekar >test1
gives the output file with the name test1.
i want to remove the line which contains the "sekar" and put the result in the new file....
what is the command for that?.. (2 Replies)
Discussion started by: sekar sundaram
2 Replies
2. UNIX for Dummies Questions & Answers
i need to seperate values seperated by delimiters and assign it to an array.. can u plz help me on that.
Variables = "asd,rgbh,(,rty,got,),sroe,9034,"
i need to assign the variables into arrays..
like..
var=asd
var=rgbh.. and so on
how do i do this. i need to reuse the values stored in... (6 Replies)
Discussion started by: Syms
6 Replies
3. Shell Programming and Scripting
Hello all,
I have some weird problem that kinda baffles me. Say I have the following test file:
claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah, this is the third test line
Then say I want to tail the file, grep for the word "third" then... (7 Replies)
Discussion started by: sylaan
7 Replies
4. Shell Programming and Scripting
Hi,
Is there any way I can grep an array against another array?
Basically here's what I need to do.
There will be an array containing some fixed texts and I have to check whether some files contain these lines. Reading the same files over and over again for each different pattern doesnt seem... (1 Reply)
Discussion started by: King Nothing
1 Replies
5. Shell Programming and Scripting
Hi
My input file looks like as follows: say a.txt
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss... (5 Replies)
Discussion started by: bittoo
5 Replies
6. Slackware
not sure how to do it. wan't to delete it using cut and grep ince i would use it in the shell.
but how must the command be?
grep "64.233.181.103 wwwGoogle.com" /etc/hosts | cut -d
the delimeter is just a space. can you help meplease. :D (1 Reply)
Discussion started by: garfish
1 Replies
7. Shell Programming and Scripting
file.txt : is delimiter:
abc:def:ghi
jkl:mno: pqr
123:456:789
if I do the cut command, and cut the first column, and echo it out
I will get the output:
abc
jkl
123
How can I assign the column of text that I've cut into Array?
e.g If I were to echo array array it will output as:... (9 Replies)
Discussion started by: andylbh
9 Replies
8. Shell Programming and Scripting
This is my command-line code in my script,
passwd=`grep $passwd $userfile | cut -f2 -d: login_users > retrieve`
the
cut -f2 -d: login_users > retrieve
searches and prints the whole column two. what I need is one of the items in the column two only.. what option can I add to my cut... (2 Replies)
Discussion started by: jenimesh19
2 Replies
9. Shell Programming and Scripting
Hi,
I have a SQL script with "create table" and "alter table" statements and I want to cut all the alter table statements from original file (A) and move it to a different file (B).
Can you please me the option. Thanks a lot for your time. (3 Replies)
Discussion started by: bhupinder08
3 Replies
10. Shell Programming and Scripting
Hi everyone, thank you so much for reading.
I built a user reference page from /etc/password for a class project. Now I need two shell scripts: 1) Add names to the reference page 2) Delete names from the reference page. I know grep -v is involved somehow and some piping but I am super stuck.
... (1 Reply)
Discussion started by: jsmpdx
1 Replies
LEARN ABOUT SUNOS
unexpand
expand(1) User Commands expand(1)
NAME
expand, unexpand - expand TAB characters to SPACE characters, and vice versa
SYNOPSIS
expand [-t tablist] [file...]
expand [-tabstop] [ -tab1, tab2,. . ., tabn] [file...]
unexpand [-a] [-t tablist] [file...]
DESCRIPTION
The expand utility copies files (or the standard input) to the standard output, with TAB characters expanded to SPACE characters. BACKSPACE
characters are preserved into the output and decrement the column count for TAB calculations. expand is useful for pre-processing character
files (before sorting, looking at specific columns, and so forth) that contain TAB characters.
unexpand copies files (or the standard input) to the standard output, putting TAB characters back into the data. By default, only leading
SPACE and TAB characters are converted to strings of tabs, but this can be overridden by the -a option (see the OPTIONS section below).
OPTIONS
The following options are supported for expand:
-t tablist Specifies the tab stops. The argument tablist must consist of a single positive decimal integer or multiple posi-
tive decimal integers, separated by blank characters or commas, in ascending order. If a single number is given,
tabs will be set tablist column positions apart instead of the default 8. If multiple numbers are given, the tabs
will be set at those specific column positions.
Each tab-stop position N must be an integer value greater than zero, and the list must be in strictly ascending
order. This is taken to mean that, from the start of a line of output, tabbing to position N causes the next char-
acter output to be in the (N+1)th column position on that line.
In the event of expand having to process a tab character at a position beyond the last of those specified in a mul-
tiple tab-stop list, the tab character is replaced by a single space character in the output.
-tabstop Specifies as a single argument, sets TAB characters tabstop SPACE characters apart instead of the default 8.
-tab1,tab2,...,tabn Sets TAB characters at the columns specified by -tab1,tab2,...,tabn
The following options are supported for unexpand:
-a Inserts TAB characters when replacing a run of two or more SPACE characters would produce a smaller output file.
-t tablist Specifies the tab stops. The option-argument tablist must be a single argument consisting of a single positive decimal
integer or multiple positive decimal integers, separated by blank characters or commas, in ascending order. If a single
number is given, tabs will be set tablist column positions apart instead of the default 8. If multiple numbers are given,
the tabs will be set at those specific column positions. Each tab-stop position N must be an integer value greater than
zero, and the list must be in strictly ascending order. This is taken to mean that, from the start of a line of output,
tabbing to position N will cause the next character output to be in the (N+1)th column position on that line. When the -t
option is not specified, the default is the equivalent of specifying -t 8 (except for the interaction with -a, described
below).
No space-to-tab character conversions occur for characters at positions beyond the last of those specified in a multiple
tab-stop list.
When -t is specified, the presence or absence of the -a option is ignored; conversion will not be limited to the processing
of leading blank characters.
OPERANDS
The following ooperand is supported for expand and unexpand:
file The path name of a text file to be used as input.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of expand and unexpand: LANG, LC_ALL,
LC_CTYPE, LC_MESSAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|CSI |enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
tabs(1), attributes(5), environ(5), standards(5)
SunOS 5.10 1 Feb 1995 expand(1)