Search Results

Search: Posts Made By: Pradeep_1990
4,557
Posted By Corona688
It might be better to redirect...
It might be better to redirect /home/user/prod_work/xyz.sh to /dev/null, to fix it on the remote side, instead of the local side. Less round-trip, and saves you one stream if you ever need it later.
Forum: Red Hat 06-18-2014
2,785
Posted By cnamejj
Other people might have the same question I do,...
Other people might have the same question I do, which makes it difficult to suggestion a solution. I'm not sure what "fully loaded" means?

If you just want to know if the website is up and...
1,455
Posted By RudiC
Try read -p "Please enter the name of the...
Try read -p "Please enter the name of the application: " DIRTOCREATE
printf "%s %s " $DIRTOCREATE "=" >result.txt
TMP=""
read -p "Please enter the number of associates to be given access to svn:"...
3,150
Posted By balajesuri
#! /bin/bash i=1 while read line do ...
#! /bin/bash
i=1
while read line
do
if [ $(echo $line | grep ingredient) ] && [ $i -eq 1 ]
then
echo $line
cat items.txt
(( i++ ))
else
echo...
3,150
Posted By Yoda
Using shell builtins: #!/bin/bash while...
Using shell builtins:
#!/bin/bash

while read line
do
printf "%s\n" "$line"
if [[ "$line" =~ "ingredient" ]]
then
[ -z "$flag" ] && cat items.txt
...
22,131
Posted By sea
Just a little addition (and using what just...
Just a little addition (and using what just learned) :

read -p "Please enter the dirname to create: " DIRTOCREATE
[ ! -e "$DIRTOCREATE" ] && mkdir -p "$DIRTOCREATE"
22,131
Posted By bakunin
ahem.. you probably want it the other way...
ahem..

you probably want it the other way round ;-) :

[ ! -e "$DIRTOCREATE" ] && mkdir -p "$DIRTOCREATE"

bakunin
22,131
Posted By radoulov
Or: [ -e "$DIRTOCREATE" ] || mkdir -p --...
Or:
[ -e "$DIRTOCREATE" ] || mkdir -p -- "$DIRTOCREATE"
1,007
Posted By blackrageous
I did not test this, but something like... ...
I did not test this, but something like...


find <top-level-directory> -type f | while read INFILE
do
if grep -q shyam ${INFILE}
then
sed -e "s/shyam/ram/g"...
5,194
Posted By in2nix4life
dt=$(echo "$(date --date="1 month ago" +%Y%m)") ...
dt=$(echo "$(date --date="1 month ago" +%Y%m)")
./createstructure $(echo $dt)
22,131
Posted By bakunin
To expand on what wisecracker said: whenever you...
To expand on what wisecracker said: whenever you write a script - especially one which depends on user input - you should strive to have an answer to every problem that might happen. The script does...
22,131
Posted By wisecracker
As an addendum to Ashkay's post... ALWAYS...
As an addendum to Ashkay's post...
ALWAYS remember to check if the directory/folder/drawer exists or not to prevent
unwanted error reports.
Checking applies to files, etc, across the board to...
22,131
Posted By Akshay Hegde
Welcome to the forums... Try : #!...
Welcome to the forums...

Try :

#! /bin/bash
echo "Enter name of dir":
read filename
mkdir -p $filename
22,131
Posted By Don Cragun
You might want to use: if [ -e "$drawer"...
You might want to use:
if [ -e "$drawer" ]instead of:
if [ -d "$drawer" ]
The -e will evaluate to true if any file (whether or not it is a directory) already exists with the given name. A call to...
22,131
Posted By wisecracker
"if" is obvious. "[" means the same as the...
"if" is obvious.
"[" means the same as the command "test" as in here:-
Last login: Sat Feb 8 15:21:40 on ttys000
AMIGA:barrywalker~> drawer="/Users/barrywalker/Desktop/Code"
AMIGA:barrywalker~>...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 05:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy