03-22-2004
Re: How to print content on the screen
Quote:
Originally posted by aadba
I have the following questions regrading Unix commands.
1. Could you provide the commands how to print the content of .profile and .shrc files on the screen using more and piple command? or a better way?
perhaps this?
cat filename | more
Quote:
2. How can i use the head and tail to display lines from 25 through 75... or a better solution?
perhaps this way?
head -n 75 filename | tail -n 51
limitation: this assumes that the lines 25-75 do exist
Quote:
3. How to search the /etc/password that begins with character with the character "a"?
Thank you much in advance!
-Ryan
perhaps this will work?
awk '{ if( substr($0, 1, 1) == "a" ) print $0 }' /etc/password
(requires sufficient authorization)
I'm by no means an expert, there may be better ways in all cases.
regards,
ropers
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I did a search for this topic but I couldn't find it and I was sure I have seen something similar before (hard because I am not sure of the criteria for the keywords)
What I was looking for was to be able to echo a message to the screen from a bash.sh script at the same time logging it to a... (2 Replies)
Discussion started by: Shakey21
2 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
Perhaps a dumb question, but how do you do a "print screen" within the X-Window in linux. I'm running KDE, is there a utility I can use in that package that I'm not aware of. Or, is there a way to turn on the <alt><print-screen> function with the keyboard?
Thanks in advance.
VJ (2 Replies)
Discussion started by: vancouver_joe
2 Replies
3. UNIX for Advanced & Expert Users
I have the following questions regrading Unix commands.
1. Could you provide the commands how to print the content of ".profile" and ".shrc" files on the screen using "more" and "piple" command?
2. How can i use the "head" and "tail" to display lines from 25 through 75...
3. How to search... (1 Reply)
Discussion started by: aadba
1 Replies
4. Shell Programming and Scripting
Hello all!..
does anyone know the syntax to print to the screen and to a file?
Im using something like
AWK ....
print header |tee -a invalid_csv_file ;
END {..}
' invalid_csv_file="$invalid_csv_dir_file"
but no joy?
I get sh:... (2 Replies)
Discussion started by: satnamx
2 Replies
5. AIX
Hi all,
Could you please tell me how to take a screenshot in aix (like Print Screen button in windows)?
Thanks (7 Replies)
Discussion started by: prashantchavan
7 Replies
6. Shell Programming and Scripting
Hi
Is there some kind of generator in the internet which could help me to create a table where i will place some values.
Trying to do this with echo cmd, but maybe you will suggest me some generator fo r this.
thx.
---------- Post updated at 10:59 AM ---------- Previous update was at... (2 Replies)
Discussion started by: presul
2 Replies
7. Shell Programming and Scripting
Hello everyone,
Following command sends word 'test' followed by an enter into a screen session (in our case screen_1). How do I print the result, if that would result ? How do I print the result, even if the program running in the session is locked ?
Thank you :)
screen -S screen_1 -X... (5 Replies)
Discussion started by: akula_1986
5 Replies
8. Shell Programming and Scripting
Hi,
I've stored the output of a command into a variable.
The variable contains the following output:
outputline1 outputline2 outputline3 ...
How can I echo the variable so that the output is as follow and not one line:
outputline1
outputline2
outputline2
...
Thanks a lot! (4 Replies)
Discussion started by: Sego
4 Replies
9. SuSE
When I execute below script I see a bunch of 'y' on the screen. I am wondering if the command is being executed. Is this normal and should I wait to finish?
Thanks,
output over /var/opt/Teradata/bteqdba/TAREAS_DBA.log
enable scriptmode
scope vproc all
showspace
packdisk
y
... (3 Replies)
Discussion started by: JDBA
3 Replies
10. Shell Programming and Scripting
c()
{
if something failed;then
echo "failed"
exit 1
fi
}
f()
{
functinona #if something failed call "c"
functionb #if something failed call "c"
}
f > log 2>&1 #put the log to file not print on the screen
I want all the stdout/stdrr to the log file... (3 Replies)
Discussion started by: yanglei_fage
3 Replies
LEARN ABOUT DEBIAN
mdm.screen
MDM.SCREEN(1) User Commands MDM.SCREEN(1)
NAME
mdm.screen - run a command under mdm-master
SYNOPSIS
mdm.screen [-c iospec] [-n slaves] command
DESCRIPTION
mdm.screen runs command under mdm-master so that mdm-run commands in command can run in parallel.
This program is a part of the Middleman System (mdm).
OPTIONS
The mdm.screen command has two optional options.
-c iospec
The iospec file (see below).
-n slaves
The number of mdm-slave process to start (default 6).
THE IOSPEC FILE
mdm-master uses the iospec file to decide whether two commands interfere with each other, and it only runs two commands at the same time if
they do not interfere.
Each line of the iospec file specifies the I/O behavior of a program, unless the line starts with a '#' character, in which case the line
is treated as comments and ignored. The format is as follows:
program spec spec ...
program names the program whose behavior you are specifying. For each spec element, the first character indicates usage, and the remaining
characters indicate resource.
A resource that starts with a '-' character represents the argument of the corresponding program option. A resource that is an empty
string represents a program argument. A resource that is not empty and does not start with a '-' character represents the resource string
itself.
A usage is typically an upper-case character. If two commands access the same resource with different usage, mdm-master will not run these
two commands at the same time. Furthermore, if a command access a resource with 'W' usage, mdm-master will not run it with any command
that access the same resource in any way (including 'W'). There is a special case: if usage is '0' and resource starts with a '-' charac-
ter, it means that the resource program option does not take any arguments.
All programs has an implicit spec 'Rglobal', so if you mark a program as 'Wglobal', it will not run while any other command is running.
Here is an example to help clarify matters. Suppose we have the following iospec file:
cc W-o 0-c R
rm W
Then these two commands can run at the same time:
cc -o pa pa.o lib.o
cc -o pb pb.o lib.o
These two commands cannot run at the same time:
cc -o pa.o -c pa.c
cc -o pa pa.o lib.o
And these two commands also cannot run at the same time:
cc -o pa pa.o lib.o
rm pa
EXIT STATUS
The exit status of mdm.screen is 0.
EXAMPLE
Here is what you do to decompress all files with .gz extension in the current directory tree.
mdm.screen find . -iname '*.gz' -exec mdm-run gunzip {} ;
Since we run find under mdm.screen and invoking gunzip under mdm-run, we specify that we wish to run the gunzip commands in parallel.
SEE ALSO
mdm-run(1), mdm-sync(1), ncpus(1)
Linux 2009-03-06 MDM.SCREEN(1)