10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I'm facing a different behaviour with one of my shell script for last few days. It was working good before that.
here is my code for the script FileRemove.sh
#get the file name#
file1=$1
file2=$2
rm $file1 # delete the old file
mv $file2 <target path> #move the new file to the target... (5 Replies)
Discussion started by: poova
5 Replies
2. UNIX for Dummies Questions & Answers
hi guys,
jus some file globbing questions
sed "s/^.*on//"
what does the full stop and asterisk means?
i onli know that ^ means inverse or not (1 Reply)
Discussion started by: ment0smintz
1 Replies
3. Shell Programming and Scripting
Hi guys,
Here is a simple script. It writes the current time to specific files in a directory.
The arguments are the names of the files to write the date to (without path nor extension).
root:~# cat /usr/local/bin/dummy.sh
#!/bin/sh -e
for file in $@; do
date >> /var/lib/$file.dat... (11 Replies)
Discussion started by: chebarbudo
11 Replies
4. Homework & Coursework Questions
Hello, have anybody any idea, how to negate some expression?
I have code that greps somethnig and I want filter from it some results...How to make it?
IDontWantThisExpression=$1
grep 'some regex' | grep '$IDontWantThisExpression' testfile.txt
Thanks for any advices.
Faculty of... (2 Replies)
Discussion started by: Dworza
2 Replies
5. Shell Programming and Scripting
Hi all,
I've been searching the internet and can't find an answer to this. Im trying to figure out how to negate a whole expression befor an if. I'll explain below.
Let's say
x=0
y=1
] (this is false) I would like to negate this whole boolean condition. To negate the above... (4 Replies)
Discussion started by: rethymno19
4 Replies
6. Shell Programming and Scripting
How can I pass in an argument such as "*.k" to a bash script
without having to double-quote *.k and not having *.k
`glob` to match all files in the pattern?
I tried using noglob in my script but this didn't work the way I thought
it would.. expansion is still occuring, $# is higher than I... (3 Replies)
Discussion started by: zoo591
3 Replies
7. Shell Programming and Scripting
Guys,
Pl suggest me how to ignore a path in find command... I am aware of using "!" for other option... but how can i use it like this exampl...
I want to search something for in / but not in
Pl help.
Thanks.. (2 Replies)
Discussion started by: clx
2 Replies
8. Shell Programming and Scripting
I am taking an online course on Unix scripting. The topic is Unix arithmetic operators and the lesson is Logical and bitwise operations. It is not clear how much storage space Unix uses to represent integers that are typed. Bitwise negation caused me to question how many bits are used to... (3 Replies)
Discussion started by: dLloydm
3 Replies
9. Shell Programming and Scripting
I am on HP-UX and I am trying to come up with a method to call in a list of files named like so.
filename020107.dat filename020207.dat filename020307.dat
Obviously I can list them ls them like so, ls filename*.dat. In case you did not notice the number is a date and I was hoping to match... (4 Replies)
Discussion started by: scotbuff
4 Replies
10. Shell Programming and Scripting
I would like to process a list of files matching: GPS*\.xyz with an awk script. I would then like to output the files to GPS*\.xyz.out (e.g. the same file name appended with .out). Something like:
awk '{if(NR==1) {offset=-$1}; $1=$1+offset; print }' GPS*.xyz
this does exactly what I want EXCEPT... (3 Replies)
Discussion started by: franzke
3 Replies