09-03-2008
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have 10 database instances runnning in one unix box. To connect to each database..i have to set the environment. I am trying to write a shell script to set my environment for database by just tying the oracle instance name
After logging into the unix machine... i want to type the... (3 Replies)
Discussion started by: castlerock
3 Replies
2. Shell Programming and Scripting
Hi all,
Here is my shell script
#!/bin/sh
echo "What is your name"
read name
echo "What is your surname"
read surname
echo "Your name is:${name} and your surname is:${surname}"
How can I modify this script so that I input those two variables from console?Lets say my name is "first"... (3 Replies)
Discussion started by: c0mrade
3 Replies
3. UNIX for Advanced & Expert Users
Hello,
I am making a script to copy files interactively from one directory to another using the "i" option because I dont want to overwrite the files.
cp -i *.html ./../otherdir/
cp: do you want to overwrite (y/n) ?
I used
cp -i *.html ./../otherdir/
ans='n'
read $ans
... (4 Replies)
Discussion started by: telecomics
4 Replies
4. UNIX for Advanced & Expert Users
how can we give input to parent shell?
i mean shell that is creating a child and our c prograame will run on that child..and then it return to parent shell..
what i want to do i want execute a c programe that will give command as input to parent shell & get output from parent shell and... (1 Reply)
Discussion started by: gajju
1 Replies
5. Shell Programming and Scripting
Hello!
Need help with the following:
#!/bin/bash
streamripper http://mp3-live.swr.de/swr2_m.m3u -D ~/RadioMitschnitt -l 200 > /dev/null 2>&1
I want to change the script so that it asks for an input for "-l 200" (means length 200sec) and starts then with the new value for "-l".
Can I do this... (2 Replies)
Discussion started by: urug3170
2 Replies
6. Shell Programming and Scripting
Hi all
i have the command called printer which needs a usernmae for example i would run the commnad
printer <username>
how can i write i quick script in perl that if the username is ab then write "denined" and if it is anything else it will work
thanks
Adam (1 Reply)
Discussion started by: ab52
1 Replies
7. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I'm fairly confident I can brute force this assignment, but let's not do that ;-).
Basically I'm required to support input such as ps aux | grep blah >> blah.txt& echo 'slslslsl'
My question is what is the best way to parse that... (4 Replies)
Discussion started by: someoney3000
4 Replies
8. Shell Programming and Scripting
Hi,
I'm trying to create files in ccm thru a shell as the number of files that i need to create is in hundreds
The problem here is the command prompts for the file type to be entered by the user. I need all the files to be created with "ascii" as file type. So how can i input a... (1 Reply)
Discussion started by: dvah
1 Replies
9. Shell Programming and Scripting
i want to get input and depending on it create new commands for input to expect.
But problem is that after giving date or month as 01-09 it is interpretation as 1-9
echo -n "ENTER DATE "
read d1
echo -n "ENTER MONTH "
read m1
echo -n "ENTER YEAR"
read y1
o=1
i=1
d2=`expr $d1... (1 Reply)
Discussion started by: sagar_1986
1 Replies
10. Shell Programming and Scripting
I still cannot figure out how to get this read command to work. I want the script to ask questions when prompted, and the user to enter a response. Based on response it will continue or exit. I have not worked with this type of script before so I am almost clueless on what to do, and so far google... (6 Replies)
Discussion started by: bigbenn
6 Replies
CUT(1) BSD General Commands Manual CUT(1)
NAME
cut -- cut out selected portions of each line of a file
SYNOPSIS
cut -b list [-n] [file ...]
cut -c list [file ...]
cut -f list [-d delim] [-s] [file ...]
DESCRIPTION
The cut utility cuts out selected portions of each line (as specified by list) from each file and writes them to the standard output. If no
file arguments are specified, or a file argument is a single dash ('-'), cut reads from the standard input. The items specified by list can
be in terms of column position or in terms of fields delimited by a special character. Column numbering starts from 1.
The list option argument is a comma or whitespace separated set of numbers and/or number ranges. Number ranges consist of a number, a dash
('-'), and a second number and select the fields or columns from the first number to the second, inclusive. Numbers or number ranges may be
preceded by a dash, which selects all fields or columns from 1 to the last number. Numbers or number ranges may be followed by a dash, which
selects all fields or columns from the last number to the end of the line. Numbers and number ranges may be repeated, overlapping, and in
any order. If a field or column is specified multiple times, it will appear only once in the output. It is not an error to select fields or
columns not present in the input line.
The options are as follows:
-b list
The list specifies byte positions.
-c list
The list specifies character positions.
-d delim
Use delim as the field delimiter character instead of the tab character.
-f list
The list specifies fields, separated in the input by the field delimiter character (see the -d option.) Output fields are separated
by a single occurrence of the field delimiter character.
-n Do not split multi-byte characters. Characters will only be output if at least one byte is selected, and, after a prefix of zero or
more unselected bytes, the rest of the bytes that form the character are selected.
-s Suppress lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of cut as described in environ(7).
EXIT STATUS
The cut utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Extract users' login names and shells from the system passwd(5) file as ``name:shell'' pairs:
cut -d : -f 1,7 /etc/passwd
Show the names and login times of the currently logged in users:
who | cut -c 1-16,26-38
SEE ALSO
colrm(1), paste(1)
STANDARDS
The cut utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').
HISTORY
A cut command appeared in AT&T System III UNIX.
BSD
December 21, 2006 BSD