10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
read a
if test grep EOF $a
then echo yes file
else
echo no
fi (1 Reply)
Discussion started by: iamsumibisht
1 Replies
2. Shell Programming and Scripting
As an exercise, I'm trying to re-write this code without the compound square brackets, using grep and test. Need to know what to do about the "equal-tilde".
#!/bin/bash
# test-integer2: evaluate the value of an integer.
INT=-5
if +$ ]]; then
if ; then
echo "INT is zero."
else
if ; then... (17 Replies)
Discussion started by: Xubuntu56
17 Replies
3. Shell Programming and Scripting
cat abc.txt
Filename: SHA_AED_Monthly_SNR_20150331.txt.gz
Data Format: ASCII with carriage returns and linefeeds
Compression: GZIP
GZIP Bytes: 36893068
Unzipped Bytes : 613794510
Records: 851310
Record Length: 738
Blocksize: 32472
Filename: SHA_AED_SNR_ChangeLog_20150331.txt.gz
Data... (16 Replies)
Discussion started by: dotran
16 Replies
4. Shell Programming and Scripting
Hi all. I am trying to compare and filter two files. I have a bigfile.txt of names and ids and a smallfile.txt of ids only. What I am trying to do is use a while read loop to read the ids in the bigfile and then echo the name and id only if the id exists in the small file. Basically, I'm trying to... (5 Replies)
Discussion started by: jameswatson3
5 Replies
5. Shell Programming and Scripting
Hello All,
I have been reading posts on here for a while, but this is my first post. I have a document in which many sentences appear, and I am piping it through an exterior script which will tag each word in the document with its part of speech (not part of my script, just background). The... (3 Replies)
Discussion started by: daf189
3 Replies
6. Shell Programming and Scripting
hi i need help with below code.
if ]
then
log "Exiting the script as ID= NULL"
log "Please run script first."
fi
i am calling grep inside this but its not running any ideas why ??
input file is like this --
Msg 102, Level 20, State 1:
Server... (4 Replies)
Discussion started by: dazdseg
4 Replies
7. Shell Programming and Scripting
Hello ...again.
I am stuck on this part, I have a loop with processes an operations file.
and calls different functions depending on what is in loop, which processes a database file...
#so far my add function works as intended
add()
{
...blah blah;
}
# delete is kinda working... (13 Replies)
Discussion started by: gcampton
13 Replies
8. UNIX for Dummies Questions & Answers
Hello, i have a script which checks if the user entered 8 numeric characters in the form of YYYYMMDD (birth date). If the user entered any non numeric characters, an error will be displayed:
# Check to see if the 8 characters are all numbers
# If not show error essage
# And prompt user... (4 Replies)
Discussion started by: netmaster
4 Replies
9. Shell Programming and Scripting
Okay, well this is more or less my first attempt at writing a shell script.
Anyways, here's my code:
cd ${PATH}
if
then
rm ${FILE}
./anotherScript
else
exit 1
fi
exit 1
Anyways, it's a pretty simple script that is supposed to search for the... (4 Replies)
Discussion started by: cbo0485
4 Replies
10. Shell Programming and Scripting
par='one" -e "two'
I want to expand the variable (a little bit more complex) in a grep construction like this (obviously not working):
ls |grep -e "${par}"
i tried different methods with eval with no result
Is there any way to archive this?
Thx in advance mates! (3 Replies)
Discussion started by: Klashxx
3 Replies