10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello folks!
I have a file containing lines like this
Something text 18:37Remove This: 1,111"Keep this text"
Some more text 19:37Remove This: 222"Keep this text"
More text 20:50Remove This: 3,333Keep this text
And more text 25:50Remove This: 44,444Keep this text
I would like to... (4 Replies)
Discussion started by: martinsmith
4 Replies
2. Shell Programming and Scripting
Hi
I have assigned an output of a command to $I. I try to print the input and put a new line after occurrence of the hostname which is assigned to $HOST1 ( Example: pwrm16 ) . First of all I need to get rid of the Colon after the host name pwrm16: and make it pwrm16 then I want to print the... (10 Replies)
Discussion started by: mnassiri
10 Replies
3. What is on Your Mind?
Well you lot seriously amaze me.
There was a thread a few hours ago, (on the date stamp shown in this upload), that generated loads of solutions to a fairly simple problem:-
https://www.unix.com/shell-programming-scripting/235829-how-print-particular-character-n-number-times-line.html
As a... (0 Replies)
Discussion started by: wisecracker
0 Replies
4. UNIX for Dummies Questions & Answers
Hi!
I was looking for files to clean out, and I remembered reading somewhere that you could pipe the output of grep to rm. But I prefer to mv stuff to ~/.Trash/
I thought I'd try something like this:
ls ~/Library/Preferences/ |grep '.*.\.iTunes\.plist\..*' |xargs -J % mv % ~/.Trash/
I... (12 Replies)
Discussion started by: sudon't
12 Replies
5. UNIX for Dummies Questions & Answers
Hey Guys & Gals,
I am trying to figure out how one would go about printing all
possible variations of letter cases in a given word.
So if for instance given the input "test123"
output would be ;
test123
Test123
TEst123
TESt123
TEST123
tEst123
tESt123
tEST123
teSt123
teST123... (1 Reply)
Discussion started by: TAPE
1 Replies
6. Shell Programming and Scripting
Hi there,
I have a bunch of files that I want to modify.
As a beginner, but nevertheless enthusiast, in the use of the shell I want to create a script enabling me to modify those files quickly.
I had only some partial success with various peaces of scripts but I would like to create one script... (1 Reply)
Discussion started by: iamzesh
1 Replies
7. UNIX for Dummies Questions & Answers
This should be so easy...
I want to find all the apps in /Applications that start with the lower case i (e.g. iTunes.app, iSync.app, iCal.app) They should all have the .app extension. I've tried:
ls /Applications |grep -o i*.app
ls /Applications/i*.app
Anyhow, I just want to see what apps... (2 Replies)
Discussion started by: glev2005
2 Replies
8. Shell Programming and Scripting
I tried searching for answers but didn't find any.
When I grep a file results read
4.2.2.2
4.4.4.2
4.5.6.7
But I just want to select each result individually. For Example I want to be able to say
variable1="first grep result"
variable2="second grep result"
variable3="third grep... (8 Replies)
Discussion started by: elbombillo
8 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
Would like to know how I could search for a string 'xyz' but have the output show the line plus the line above and/or below all lines found.
eg. search for xyz from file containing:
abc
12345
asdf xyz asdfds
wwwww
kjkjkj
ppppp
kkkxyz
eeee
zzzzz
and the output to... (2 Replies)
Discussion started by: sammac
2 Replies
10. Shell Programming and Scripting
Hi
I have a such conditional:
SPAMH="it is SPAM"
if grep -q $SPAMH $NMDIR/$mail; then
SPAMHFLAG=1
else
SPAMHFLAG=0
fi
And grep doesn't catch this string, even it exists there. I think it's a problem with passing $SPAMH to grep. I tried... (2 Replies)
Discussion started by: xist
2 Replies