06-14-2013
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies
2. Shell Programming and Scripting
Hi ,
could anyone help me out with this problem.
sample.txt has this content :
u001- this is used for project1 ||
u002- this is used for p2|| not to be printed
u003- this is used
for project3 ||
u004- this is
used for p4 ||
u005- this is used for project5 ||
u006- this is used for p6... (9 Replies)
Discussion started by: Balaji PK
9 Replies
3. UNIX for Dummies Questions & Answers
I'm writing a script to get a datestamped file from a ftp server. It seems that the "get" command does not respect variables. Anyone knows how to fix the problem?
I'm trying to get a file named "rcsnotesYYYYMMDD"
Here's my script
today=`date +%Y%m%d`
tput clear
user <login> <password>... (1 Reply)
Discussion started by: mliu3
1 Replies
4. UNIX for Dummies Questions & Answers
I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename?
#!/bin/bash
filename=`echo $0`
/usr/bin/sed '/#include/ {
i\
the filename is `$filename`
}' $1
exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies
5. Shell Programming and Scripting
Hi all,
I want write a script to display 5rows at times from a input file.
my out like:
echo " display started"
r1
r2
r3
r4
r5
... Some action items...
again i need next 5 lines.
can you please advise. (2 Replies)
Discussion started by: koti_rama
2 Replies
6. Shell Programming and Scripting
Hello All,
I don't write scripts very often, and in this case I am stumped, although it may be a bug in the version of bash I have to use (it's not my system).
I want to extract a specific string snippet from a block of text (coming from a log file) that is dependent on a bunch of other... (1 Reply)
Discussion started by: jaimielives
1 Replies
7. Shell Programming and Scripting
I am scripting a process where usernames are added to the end of a specific line in a file.
using this:
awk 'NR==1{$NF=$NF" TEXT"}1' myfileworks, and then I would use > tempfile && mv tempfile myfile
HOWEVER. Being that this is to be scripted, I am trying to do something like:
awk:... (8 Replies)
Discussion started by: magicjoe
8 Replies
8. Shell Programming and Scripting
How can I accomplish this? I basically want to merge two variables onto the same line. I can do it with two FILES this way:
$ cat /tmp/users_in.list | awk -F "," '{print $2}' | cut -c -1 > first.initial
$ awk -F "," '{print $1}' /tmp/users_in.list | awk '{print $1}' > last.name
$ paste... (5 Replies)
Discussion started by: greenlightening
5 Replies
9. UNIX for Dummies Questions & Answers
I have a number of files in the /tmp directory with PET-DOG in their name. I want to delete them, leaving only files with PET-CAT and PET-HORSE. I'd like to use the find command to locate those files (by using a variable) and then I'd like to delete them. However, I can't find a way to do this. I... (3 Replies)
Discussion started by: newbie2010
3 Replies
10. Shell Programming and Scripting
Hello All,
Could you please do help me here as I would like to perform parameter expansion in shell over a parameter expansion.
Let's say I have following variable.
path="/var/talend/nat/cdc"
Now to get only nat I could do following.
path1="${path%/*}"
path1="${path1##*/}"
Here... (8 Replies)
Discussion started by: RavinderSingh13
8 Replies
LEARN ABOUT NETBSD
clrtoeol
CURSES_CLEAR(3) BSD Library Functions Manual CURSES_CLEAR(3)
NAME
curses_clear, clear, wclear, clearok, clrtobot, clrtoeol, erase, werase, wclrtobot, wclrtoeol -- curses clear window routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
int
clear(void);
int
clearok(WINDOW *win, bool flag);
int
clrtobot(void);
int
clrtoeol(void);
int
erase(void);
int
wclear(WINDOW *win);
int
werase(WINDOW *win);
int
wclrtobot(WINDOW *win);
int
wclrtoeol(WINDOW *win);
DESCRIPTION
These functions clear all or part of stdscr or of the specified window.
The clear() and erase() functions erase all characters on stdscr. wclear() and werase() perform the same function as clear() and erase(),
respectively, excepting that the specified window is cleared.
By setting flag to TRUE, the clearok() function is used to force the next call to wrefresh() to clear and completely redraw the window given
in win.
The function clrtobot() will clear stdscr from the current row to the bottom of the screen. clrtoeol() will clear stdscr from the current
column position to the end of the line. wclrtobot() and wclrtoeol() are the same as clrtobot() and clrtoeol(), respectively, excepting the
window specified is operated on instead of stdscr.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO
curses_refresh(3)
STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.
BSD
August 12, 2002 BSD