10 More Discussions You Might Find Interesting
1. 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
2. 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
3. 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
4. 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
5. 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
6. 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
7. 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
8. 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
9. 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
10. 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