Need help on making a loop script base on what is inside a file...
File to read: List.txt
List.txt contains below w/c are file name as well:
SAMPLEa
SAMPLEb
SAMPLEc
SAMPLEd
SAMPLEe
SAMPLEf
.
.
.
Want to make a loop that will manipulate those that are inside the file.txt w/c are... (3 Replies)
I am writing a shell script using the korn shell. It seems that I am only
able to use local variables within a while loop that is reading a file.
(I can't access a variable outside a previously used while loop.) It's been
a while since I wrote shell scripts. Here is a sample
cat file.txt... (4 Replies)
Hi,
I am building a script to grep for a string in all the files from a folder and display the results.
I am reading the files one by one by placing the names in other file using while loop
my code is as below
while read inp
do
chk=`grep -c "$str" $pth/$inp`
... (2 Replies)
I have written a script to read the file line by line.
It is reading and printing the lines.
But it is coming out of loop before reading last line.
So I am not able to print last line.
How do I solve it. (6 Replies)
Hi,
I am on HP-UX and K shell.
When I am using while/for loop for reading a file. It is working fine but not reading tabs:
Suppose, if the line is: ; ;COMP; ; ; ;
then loop is reading as
; ;COMP; ;... (5 Replies)
I'm having trouble with a simple piece of code.
IFS=,
echo "1,2,3,4,5,6,7,8" | while read x y
do
echo "x=$x"
echo "y=$y"
done
I'm hoping for
x=1
y=2
x=3
y=4
.
.
.
but I'm getting
x=1 (3 Replies)
Hi,
I want to read file multiple times. Right now i am using while loop but that is not working.
ex.
While read line
do
while read line2
do
echo stmt1
#processing some data based on data.,
done < file2.txt
done < file1.txt # This will have 10... (4 Replies)
Hi,
I am writing in a file through cat command. This file will contain the path of file along with filename. e.g. /home/user/folder1/folder2/filename.txt
There might be very large number of this path in same file like say 140
when I try to run while command:
while read -r file
do
//command... (8 Replies)
Hi,
I managed to read and print variable as shown in the below code.
table_name=table1,table2,table3
i=0
IFS=","
for i in $table_name
do
echo $i
done
Is there a way how I can read more than one variable. For example I need to read 2 variables and populate the output... (6 Replies)
Hello All,
I have two files with me file1.txt and file2.txt
file1.txt has:
333
222
111
file2.txt has
ccc
bbb
aaa
ccc is related to 333 only, bbb is related to 222 only and aaa is related to 111 only.
I have to get the values from each of the file and pass them in the URL... (3 Replies)
Discussion started by: ankur328
3 Replies
LEARN ABOUT ULTRIX
trace
trace(1) General Commands Manual trace(1)Name
trace - trace system calls of programs
Syntax
trace [options] cmd args...
Description
The command with no flag arguments traces for the given cmd and args all system calls made and prints a time stamp, the PID, call and/or
return values and arguments and puts its output in the file trace.dump.
Options-f filename
Puts dump in file filename.
-z Echos arguments only.
Only one of the following option arguments can be specified at one time.
-c# Traces given PIDs and their children. Up to sixteen PIDs can be specified.
-g# Traces given groups only. Up to sixteen Group IDs can be specified.
-p# Traces given PIDs only. Up to sixteen PIDs can be specified.
-s# Traces given system calls only. Up to sixteen PIDs can be specified.
-u# Traces given UIDs only. Up to sixteen PIDs can be specified.
Examples
trace -f ls.dump ls -l /dev >ls.out
runs the cmd ls -l /dev and puts the trace in ls.dump and output in ls.out.
trace -f csh.trace -p $$ &
will trace your login shell in the background. To stop the trace just send it a termination signal (that is, kill -TERM trace_pid).
Restrictions
Due to security, no one, not even the super-user can trace anyone else's programs. This sort of negates some of the usefulness of the -g
and -u flags.
The program cannot be traced.
Only 16 numbers can be given to the -c, -p, -g, -u, and -s flags.
The kernel configuration file must contain the following:
options SYS_TRACE
pseudo-device sys_trace
In addition, the superuser must use the following command sequence to create the device:
cd /dev
MAKEDEV trace
If both lines are not in the configuration file or if the device is not made, the message "Cannot open /dev/trace" appears.
Files
/dev/trace read only character special device for reading syscall data.
trace.dump default file for the system call trace data.
See Alsoopen(2), close(2), ioctl(2), select(2), read(2), trace(5)trace(1)