10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file
# cat /root/llll
11
22
33
44
When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat.
cat /root/shell_script.sh
#!/bin/bash
var=`cat /root/llll`
echo $var (2 Replies)
Discussion started by: anil510
2 Replies
2. Shell Programming and Scripting
Hi All,
I have an input file containing data as below:
Input.DAT
XXXXXXX|YYYYYYY|ZZZZZZZZZZ|12334446456|B|YY|111111111|111111111|111111111|111111111|15|3|NNNNNN|Y|3|AAA|111111111... (11 Replies)
Discussion started by: sagar.cumar
11 Replies
3. Shell Programming and Scripting
Hello,
How can I efficiently cat piped output with another file?
> (awk command) | cat file1 (piped output)
Thanks! (11 Replies)
Discussion started by: palex
11 Replies
4. Shell Programming and Scripting
Hello,
I'm trying to send the error output of a 'cat' operation to /dev/null like this:
cat /dirA/dirB/temp*.log > /dirA/dirB/final.log 2>/dev/null
This works perfectly in a terminal, but not when placed in a script.
If there are no files matching temp*.log the script outputs an error... (7 Replies)
Discussion started by: Nils88
7 Replies
5. UNIX for Advanced & Expert Users
Hi
I'm executing a menu script in which I `cat a file` but it's giving different output some times. Following is the code fragment taken from my script.
while true
do
cat procs.configured
echo ---------separator--------------
sleep 3
done
when I execute this code fragment, `cat` outputs... (2 Replies)
Discussion started by: axes
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I need to concatenate data files with a .mp extension that are stored in directories by year. I want to keep the same filename as an output for example:
for the file name p030.mp, which resides in the following subdirectories:
/2000/p030.mp
/2001/p030.mp
/2002/p030.mp
I want to:... (4 Replies)
Discussion started by: cmshreve
4 Replies
7. Shell Programming and Scripting
Hello All,
I have coded a C program which looks something like below... (program name: test.c)
#include<stdio.h>
main()
{
int dist,dm,dcm;
printf(" Enter the distance between 2 cities in KM : ");
scanf("%d",&dist);
dm=dist*1000;
dcm=dist*10;
printf("Distance between 2 cities in... (6 Replies)
Discussion started by: smarty86
6 Replies
8. Shell Programming and Scripting
Hi,
how I can display a file with cat and printing the filename before each line.
e.g.
file1 {
one
two
three
four
five
}
Output:
file1:one
file2:two
file1:three
file1:four
file1:five (12 Replies)
Discussion started by: Timmää
12 Replies
9. Shell Programming and Scripting
Hello,
I'm new to shell scripting and did a search on the forum to what I want to do but couldn't find anything.
I have about 9 routers that outputs to 1 syslog file daily named cisco.year.mo.date.log ex: cisco.2009.05.11.log
My goal is to make a parsing script that cats today's syslog... (2 Replies)
Discussion started by: jjrambar
2 Replies
10. UNIX for Dummies Questions & Answers
When I use this command I get an output of some numbers
cat ac.20070511 | cut -d" " -f19
Is there any way for me to display only the numbers that are greater than 1000 but not all the numbers in the ouput.
Can any one help me with this. :) (8 Replies)
Discussion started by: venu_nbk
8 Replies