Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
I am using GNU/Linux -bash shell
I am to Create a shell script named top_veg_cost to display the top 2 most costly vegatables for a class lab assignment
My shell script that I have so far is
out come I have so far is
when I add a sort command to the script like this
new out come is
I have no idea what command I should add to get the 2 highest cost vegetables which are
I might even need to change what I have just not sure
going to need more help with other sections of same lab just have not reached them yet
Waubonsee Community College
Sugar Grove Illinois
Professor: Tim Lippold
Linux/UNIX Operating System CIS180
Book being used is Harley Hahn's Guide to Unix and Linux
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Hi everyone
I have a problem with my script
If I try directly this command
/usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz
It works
But if I simply add this command in a script and... (8 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff |... (1 Reply)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
4. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Hi All,
I have a question related to Shell scripting. In my shell script, I have following two commands in sequence:
sed 's/^/grep "^120" /g' $ORIGCHARGEDAMTLIST|sed "s;$;| cut -f$FIELD_NO1 -d '|' | awk '{ sum+=\$1} END {printf (\"%0.2f\\\n\", sum/100)}' >$TEMPFILE
mv $TEMPFILE $ORIGFILE... (3 Replies)
I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found"
My code is as follows:
--------------------------
#!/bin/sh
user="test"
DIR="/bldtmp/"$user
VIEW="test.view1"
echo "TMPDIR before export... (4 Replies)
Hi All,
Is there any way where we can run few commands with different shell in a shell script ?
Let's have an example below,
My first line in script reads below,
#!/bin/sh
However due to some limitation of "/bin/sh" shell I wanted to use "/bin/bash" while executing few... (9 Replies)
Hello.
I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct.
We have a script (ftp.script) which calls on... (1 Reply)
i want to search in the current directory all the files that contain one word for example "hello"
i want to achieve it with the grep command but not with the grep * (2 Replies)
I'm trying to read a bunch of log files and output the lines that contain particular strings.
To accomplish this, I've been running the following from the command line:
find . -name "*" | xargs grep " " | grep " " > output.txt
Two grep statements are needed in case I'm looking for a... (3 Replies)