Sponsored Content
Top Forums Shell Programming and Scripting Help with UNIX READ command usage.. Post 302767769 by MadeInGermany on Thursday 7th of February 2013 12:03:55 PM
Old 02-07-2013
Always avoid unsafe/complex here documents
Code:
read a <<EOF
`ls -l | head -1`
EOF
echo $a

Instead do
Code:
a=`ls -l | head -1`
echo $a

$(...) is Posix, old Unix shells need `...`
Posix allows nested $(... $(...)).

As a last less good alternative you can place the echo in an explicit subshell:
Code:
ls -l | head -1 | (read a; echo $a)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK : read unix command

Hi, Is there a way to have something working like the read Unix command to stop a awk ask a question and get the result. I've try system("read a") but it does not work. Thanks. Franck. (6 Replies)
Discussion started by: fwirbel
6 Replies

2. UNIX for Dummies Questions & Answers

disk usage command on unix?

hi, Can anyone tell me how I make a tree on the console showing the largest folders on my UNIX system? I want to know where are located the biggest files so I can free some disk space. thanks a lot. (3 Replies)
Discussion started by: gandoura
3 Replies

3. UNIX for Advanced & Expert Users

unix top command (memory usage)

in unix when i use top i get an output like this: load averages: 0.64, 0.57, 0.53 14:04:42 347 processes: 1 running, 1 waiting, 169 sleeping, 172 idle, 4 stopped CPU states: 16.4% user, 2.8% nice, 7.6%... (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies

4. UNIX for Dummies Questions & Answers

need help on how to read command in unix

can any one please help me how to use "read" command for openig a file.i want to process the file record by record and then needs to search for a particular string at a particular position.can any one please let me know the code.i am new to the shell. below are sample sample records ... (3 Replies)
Discussion started by: raoscb
3 Replies

5. UNIX for Dummies Questions & Answers

Disk Usage in GB and Unix command to find the biggest file/folder

Hi All, Please help me out 1) Command to find the disk usage in GB. I know that du -k will give in kilobites. 2) How to find the Biggest file/folder in a given set of files/folders. Thanks in advance Regards, Manas (8 Replies)
Discussion started by: manas6
8 Replies

6. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

7. UNIX for Dummies Questions & Answers

Unix Top Command and sorting by CPU Usage

Ok, so I am using the Top command on my linux VPS to try and see the processes using the most CPU %. I hit the P to sort by CPU % but it wants to sort them from lowest to highest (ascending). My Telnet-SSH screen is only about 60 rows high so the processes with the highest CPU % usage are at the... (6 Replies)
Discussion started by: davemehta
6 Replies

8. Shell Programming and Scripting

Unix - Disk usage command

Hi, I need a command that gives me the user who is using more space in the unix box (1 Reply)
Discussion started by: abinaya
1 Replies

9. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

10. UNIX for Dummies Questions & Answers

Read all files in a directory for a unix command

Hello, Below, I have a unix command, which can be executable for single file. cat input.txt | sort -k3,3 > output.txt I have 100 input files in a directory. It is hectic and time taking to run the above command for all the 100 files for 100 times. Now, I want to execute the above unix... (2 Replies)
Discussion started by: koneru_18
2 Replies
ctan(3M)						  Mathematical Library Functions						  ctan(3M)

NAME
ctan, ctanf, ctanl - complex tangent functions SYNOPSIS
cc [ flag... ] file... -lm [ library... ] #include <complex.h> double complex ctan(double complex z); float complex ctanf(float complex z); long double complex ctanl(long double complex z); DESCRIPTION
These functions compute the complex tangent of z. RETURN VALUES
These functions return the complex tangent value. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
catan(3M), complex.h(3HEAD), attributes(5), standards(5) SunOS 5.10 1 Sep 2002 ctan(3M)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy