10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a bash file as following:
#!/bin/sh
deal_file(){
printf $1
printf "\t is a file"
echo
}
main(){
for file in `find "$1" `
do
deal_file $file
done
}
main $1
then I run ./t.sh .,get the following results: (1 Reply)
Discussion started by: 915086731
1 Replies
2. UNIX for Dummies Questions & Answers
Sorry for the odd title, but I couldn't think of an easy way to describe my issue.
Background
I have a home security system that continually sends (via FTP) 4 different still images to a directory on my personal website - cam0.jpg, cam1.jpg, etc. I've written an extremely basic html script to... (4 Replies)
Discussion started by: CinciJeff
4 Replies
3. Shell Programming and Scripting
Hi,
I am trying to generate list of employees from emp table who joined yesterday.
emp.sh
YEST=$(date --date='1 day ago' +%Y-%m-%d)
cat emp.sql | mysql -u <user> -p<pass> -h <host> -P <port> -D <dbname> > emp.csv
emp.sql
select * from employee where join_date = '$YEST';
I expected... (3 Replies)
Discussion started by: ravi.videla
3 Replies
4. Shell Programming and Scripting
Hi,
I have a file with occurances of the string "TO_DATE(<number here>,'J')" at random places. I need minus 2400000 from the number and replace the string with "convert(date, dateadd(dd, <new number here>,'16 Nov 1858')".
I'm finding this difficult as the string isn't necessarily in the... (9 Replies)
Discussion started by: user_invalid
9 Replies
5. Shell Programming and Scripting
Hi Everyone,
1.txt
a
b
c
d
e
f d
g
gg
output:
abc
de (3 Replies)
Discussion started by: jimmy_y
3 Replies
6. Shell Programming and Scripting
Source data:
"123","aaa bbb CCC","12000"
"134","HHH,bbc","13000"
i have a delimited file. i want to replace with the pipe.The sed command is not working for replacing a delimeter.
Command :
sed s/\,/\|/g filename
Output : When i run the command it is replacing the columns value... (7 Replies)
Discussion started by: number10
7 Replies
7. Shell Programming and Scripting
Dear all,
there are more than 10 files with .tar.gz extension in my folder i didnt want to extract them i just want to run the query to fetch my necessary data from all the files.
but when i run the command it untar the files in that folder.
gunzip -c abc.tar.gz | tar -xf - | grep REC |... (0 Replies)
Discussion started by: jojo123
0 Replies
8. Programming
Hi All,
To avoid race condition, instead of using mutex, semaphore, spinlock etc.... Is there any other mechanism by which we can avoid race condition in an multi-threading environment.
-Thanks (6 Replies)
Discussion started by: rvan
6 Replies
9. AIX
hello, I must've screwed something here..
I just had hdisk0 replaced by IBM.. now it shows up as hdisk2 instead.
Before doing that, I've had it split from hdisk1, and reduced from rootvg.
Just did a rmdev -dl hdisk2.. ran cfgmgr, but still shows up as hdisk2 instead of hdisk0.. help! (2 Replies)
Discussion started by: kiem
2 Replies
10. UNIX for Advanced & Expert Users
how do you cause a running pocess to dump a core file on linux systems??
i tried
sleep 100 &
kill -SEGV PID
but nothing is created
also, what commands can be used to analyze them? (extract useful info from them) (2 Replies)
Discussion started by: TRUEST
2 Replies